Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
Borrahh 265 Moderation Voter
5 years ago
01game.Players.PlayerAdded:Connect(function(plr)
02local stats = Instance.new("StringValue", plr)
03 
04    stats.Name = "leaderstats"
05 
06    local wins = Instance.new("IntValue", stats)
07    wins.Name = "Wins"
08    wins.Value = 0
09 
10local debounce = false
11script.Parent.Touched:Connect(function(hit)
12    if hit.Parent:FindFirstChild("Humanoid") then
13    if hit.Parent.Humanoid.Health > 0 then
14 
15    if debounce == false then
View all 31 lines...

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

2 answers

Log in to vote
1
Answered by 5 years ago

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

Ad
Log in to vote
0
Answered by
Ciyob86 25
5 years ago

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

Answer this question