#what is wrong with this
34 messages · Page 1 of 1 (latest)
its a voting system
Click on Option1 and look at the properties tab, what does it say its class and Value is?
option1.value must be nil on line 9
Make it an IntValue instead
so make the folder int value or the options
The options
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
Ok
np
@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?
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.