I am new to scripting, I tried to use debounce in this script, it does not seem to work, why? Also is my spacing/organization/neatness done correctly? Not fully sure how to order them and make the script neat.
script.Parent.Touched:Connect(function(hit)
local players = game:GetService("Players") --To get the service of players
local playerHumanoid = hit.parent:WaitForChild("Humanoid")
local hitfromPlayer = players:GetPlayerFromCharacter(hit.parent) --Getting the Player from its Character
local debounce = false
if not debounce then
debounce = true
if hitfromPlayer then
playerHumanoid.WalkSpeed = playerHumanoid.WalkSpeed + 5
print("work pls")
wait (5)
debounce = false
end
end
end)

1 comment
Oh I see, thank you