Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why It Gives me 3 Points when I touch the Part?

game.Players.PlayerAdded:Connect(function(plr) 
local stats = Instance.new("StringValue", plr)

    stats.Name = "leaderstats"
    
    local wins = Instance.new("IntValue", stats)
    wins.Name = "Wins"
    wins.Value = 0

local debounce = false
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    if hit.Parent.Humanoid.Health > 0 then
	
	if debounce == false then
		debounce = true

        print("You win")
    script.Parent.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") then
	wins.Value = wins.Value + 1 
            hit.Parent.HumanoidRootPart.CFrame = CFrame.new(234, 45.906, -114) end end)
wait(4)
debounce = false
	end 
    else
        print("You lost")
        end
        end
end)
end)

So Basically, when you touch the part, its supposed to give you 1 win only, but however it gives me 3 wins

2 answers

✓ Accepted answer

You don’t need to have two touched events! If you remove the second touched event, it should work.

Follow the first answer if it does not work then just put a wait(1) so their is a cool down.

This discussion is preserved as it was. New answers, comments, and votes are closed.