i need help for something. it my script (i want Exemple if someone touch the part that give one points only) INFO : WHEN I TOUCH IT, IT GIVE 160 POINTS AND I JUST ONE ONLY 1 POINT
WinPlace1 = script.Parent WinPlace1.Touched:connect(function() print(game.Players.LocalPlayer) wait(3) game.Players.LocalPlayer.leaderstats.point.Value= game.Players.LocalPlayer.leaderstats.point.Value +1 end)
You'll want to add a debounce, here's the new code.
WinPlace1 = script.Parent Debounce = false WinPlace1.Touched:connect(function() print(game.Players.LocalPlayer) if Debounce == false then Debounce = true game.Players.LocalPlayer.leaderstats.point.Value= game.Players.LocalPlayer.leaderstats.point.Value +1 Debounce = false end end)
@helperobc That's a good way to do it too
Here's another way (Add a delay):
WinPlace1 = script.Parent WinPlace1.Touched:connect(function() script.Disabled = true print(game.Players.LocalPlayer) wait(3) game.Players.LocalPlayer.leaderstats.point.Value= game.Players.LocalPlayer.leaderstats.point.Value +1 wait(5) script.Disabled = false end)