amount = math.random(3, 7)
script.Parent.ClickDetector.MouseClick:connect(function(pl)
local ls = pl:findFirstChild("leaderstats") local g = ls:findFirstChild("Gold")
g.Value = g.Value + amount
end)
amount = math.random(3, 7)
script.Parent.ClickDetector.MouseClick:connect(function(pl)
local ls = pl:findFirstChild("leaderstats") local g = ls:findFirstChild("Gold")
g.Value = g.Value + amount
end)
math.randomseed(tick())
script.Parent.ClickDetector.MouseClick:connect(function(pl)
local amount = math.random(3, 7)
local ls = pl:findFirstChild("leaderstats")
local g = ls:findFirstChild("Gold")
g.Value = g.Value + amount
end)
i worked for the 1st click but the rest it just went up by 6 D:
nvm it works! thx
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Please state the output.
there's no error in the out put, when i click the brick it just adds 7 to my gold stats it doesnt randomize it like i want it to