Hey everyone, i’m struggling a bit at the moment. I have a local script which is supposed to tell the server when that client has died. Then the server removes one from the list of players in a free for all.
My problem is that when the server recieves the remote event, it does not just subtract 1 from the number of duelers, but it subtracts a huge random amount. One time it was 19, another it was 7, etc… I really need to figure out how to make it only subtract once
The remote events are working fine, its just the server recieving it that’s getting all weird.
Here is the local script
local debounce
game.ReplicatedStorage.TrackDeath.OnClientEvent:Connect(function()
debounce = true
print("We are scanning for death")
game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
if debounce then
game.ReplicatedStorage.Died:FireServer(game.Players.LocalPlayer)
print("Died")
debounce = false
end
end)
end)
And here is the piece of the server script that picks it up
for count = 1, 300 do
game.Workspace.SignPart.BillboardGui.Frame.Count.Text -= 1
game.ReplicatedStorage.Died.OnServerEvent:Connect(function(player)
duelers -= 1
print("Duelers: ", duelers)
end)
if duelers == 1 then
break
end
wait(1)
end
Please help if you can. Thanks.