Hey guys, so here I am with another question.. I am currently trying to do a (Local)Script that will update the leaderstats when a Gui Textbutton is clicked.
I basically Connect my 'addPopcorn' function, but apparently I cannot pass additional parameters in the Connect? I need to tho!
local btn = game.Players.LocalPlayer.PlayerGui.popcornClick.button
local leaderstats = game.Players.LocalPlayer.leaderstats
function addPopcorn(amount)
print(typeof(amount))
leaderstats.Popcorn.Value = leaderstats.Popcorn.Value + amount
end
btn.MouseButton1Click:Connect(addPopcorn(1))
Note: I know it may seem useless now, but I will edit the amount number - ignore that. Thanks.
How would I go about passing the "1"? Says it's not a function..?
Thanks in advance, and any help appreciated!

1 comment
I can, and I did..