I watched two videos about debouncing, and both times it didn't work. I would still touch the part and it would give me 2-3 to sometimes 7 wins. I don't know why this is going wrong. Can somebody help me and explain what I'm doing wrong or if debouncing has broke?
local WinPart = script.Parent
WinPart.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if player then
local leaderstats = player:FindFirstChild("leaderstats")
local Debounce = false
if leaderstats then
if not Debounce then
Debounce = true
local Location = game.Workspace.TeleportLocation
player.leaderstats.Wins.Value = player.leaderstats.Wins.Value + 1
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(Location.Position)
wait(1)
Debounce = false
end
end
end
end)

2 comments
Nah, I'm good..
oh i didnt see this feahren