so i am being a dumbo is not know what doing. so i want this so when its touched it only gives the amount once but right now it gives it multiple times i have tried adding a wait but it made the problem worse. any idea how i would stop the script from giving to much?
amnt = 10 --how much you get for it
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("PlayerStats")
if (stats~=nil) then
local score = stats:findFirstChild("Coins")
if (score~=nil) then -- wait was here but i removed it score.Value = score.Value + amnt
end
end
end
script.Parent.Position = Vector3.new(2.581, -3.211, 19.357)
wait(10)
script.Parent.Position = Vector3.new(2.581, 1.5, 19.357)
end
end
script.Parent.Touched:connect(onTouched)

5 comments
ahem debounce
yeah... break ; debounce
Nice job pasting in the correct script this time, but you still haven't put it in code blocks like we told you last time. That wasn't a one time thing, so you should always put your code in code blocks here.
how do that
both things