So, I have this script and what I want it to do is when the player touches a brick, it sets their money to 0.
However, it only works half the time (So another script respawns is every 300 seconds).
Is there an easy way to do this?
- Michael
function onTouched(hit)
local b = game.Players:GetPlayerFromCharacter(hit.Parent)
if b.leaderstats:findFirstChild("Jump Distance").Value >= 1 then
b.leaderstats:findFirstChild("Jump Distance").Value = 0
end
end
script.Parent.Touched:connect(onTouched)

1 comment
Touched tends to do weird things. It works best if the part's CanCollide property is set to false. Try setting it to false, and see how it works.