I have a script that when a player dies it adds a value to the score board. This is a shooter game and when the player dies I found that if you continue to shoot the body until it disappears it will keep adding points.
Heres the script, I hope someone can help me out. I know it cant be too complicated, I may be over thinking it.
for i, v in pairs(game.Teams["Green Team"]:GetPlayers()) do
v.Character:WaitForChild("Humanoid").Died:connect(function()
RTkills.Value = RTkills.Value + 1
end)
end
So I figured id add more of the script, because I have a feeling people may need it
So here is the whole chunk of code that this is in.
-- Starts round and also gets players from teams
for i = GameTime, 0, -1 do
status.Value = i.." Time Left!"
-- Gets Green Team and checks to see if player died, if so give red team a point
for i, v in pairs(game.Teams["Green Team"]:GetPlayers()) do
v.Character:WaitForChild("Humanoid").Died:connect(function()
RTkills.Value = RTkills.Value + 1
end)
end
-- Gets Red Team and checks to see if player died, if so give Green team a point
for i, v in pairs(game.Teams["Red Team"]:GetPlayers()) do
end
if i == 0 then
-- Rounds over
status.Value = "Round Over!"
wait(RoundOver)
-- Give players points
for _, player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
player.leaderstats.Presents.Value = player.leaderstats.Presents.Value + 5
end
end
break
else
end
wait(1)
end
Its in a team script because its a shooter and so when someone on that team dies it adds a point. But again its triggering more than once.
Thank you for your time :)

3 comments
how many times
Its different everytime. I think it may be my gun script.
Nope its not my gun script. Because even when you reset your character it still runs multiple times