#what is wrong with this

34 messages · Page 1 of 1 (latest)

toxic jolt
#

Are Option1 and Option2 IntValues?

magic dawn
#

its a voting system

magic dawn
toxic jolt
#

Click on Option1 and look at the properties tab, what does it say its class and Value is?

sleek zinc
#

option1.value must be nil on line 9

magic dawn
#

@toxic jolt

sleek zinc
#

you can't add object values to numbers

#

what would part1 + 1 even mean?

toxic jolt
#

Make it an IntValue instead

magic dawn
sleek zinc
#

the options

#

what are you even trying to accomplish

toxic jolt
#

The options

magic dawn
#

like this?

toxic jolt
#

IntValues store a number, which will be the number of votes in your case. ObjectValues store an Instance

#

yes

#

Name them Option1 and Option2

#

And your script should work

magic dawn
#

so do icahnge the object

#

or what

#

nvm

#

i see what u mean

toxic jolt
#

Ok

magic dawn
#

itworked

#

thanks

toxic jolt
#

np

magic dawn
#

@sleek zinc @toxic jolt

#

a question

#

local plr = game.Players.LocalPlayer
local ui = plr.PlayerGui

local uiMain = ui:WaitForChild("UI")
local frameContainer = uiMain:WaitForChild("Container")

local shopContainer = frameContainer:WaitForChild("GamepassShop")
local itemsContainer = shopContainer:WaitForChild("ItemsContainer")
local itemScroller = itemsContainer:WaitForChild("ItemScroller")

local purchaseGems = itemScroller:WaitForChild("PurchaseGems")
local purchaseTokens = itemScroller:WaitForChild("PurchaseTokens")
local ninjaMoveset = itemScroller:WaitForChild("NinjaMoveset")
local purchase2xCoinsBoost = itemScroller:WaitForChild("2xCoinsBoost")
local purchase2xExpboost = itemScroller:WaitForChild("2xExpBoost") 
--Vars
local buyNinjaMovesetID = 840060245

--Registering Functions
local function registerButton(button: GuiButton & any)
    local addAmount = button.AmountToGive.Value
    local gamepassId = button.Id.Value

    button.MouseButton1Down:Connect(function()
        MarketplaceService:PromptProductPurchase(plr, gamepassId)
    end)
end

local function registerPurchaseGroup(groupParent: Instance)
    local group = groupParent:GetChildren()

    for _,button in group do
        if not button:IsA("ImageButton") then continue end

        registerButton(button)
    end
end

registerPurchaseGroup(purchaseGems)
registerPurchaseGroup(purchaseTokens)

--misc
local ninjaBuy = ninjaMoveset:WaitForChild("Buy")

if not MarketplaceService:UserOwnsGamePassAsync(plr.UserId, buyNinjaMovesetID) then
    ninjaBuy.MouseButton1Down:Connect(function()
        MarketplaceService:PromptGamePassPurchase(plr, buyNinjaMovesetID)
    end)
else
    ninjaBuy:WaitForChild("Buy").Text = "Bought!"
    ninjaBuy.Interactable = false
end

local coinsboostbuy = purchase2xCoinsBoost:WaitForChild("Buy")
local gemssboostbuy = purchase2xExpboost:WaitForChild("Buy")

 ``` do yall know how to make it so that when a player has enough gems they canbuy 2x coins boost?
toxic jolt
#

You'd have to do a check on the server to see if the player's coins are >= to the cost of the boost. If it is, then subtract the cost and give them the boost. You'd prob have to use a DataStore to store if a player has the boost or not.