So I have a brick where you step on it and it rewards points. The problem is that if I set it to add 10 points, it adds 10 points extremely rapidly. I can't seem to get to add 10 points and then that's it.
Here is the code:
amnt = 10
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local score = stats:findFirstChild("Points")
if (score~=nil) then
score.Value = score.Value + amnt
end
end
end
end
end
script.Parent.Touched:connect(onTouched)
