It does fire but only works for 1 player
Are you testing this in studio or in a published place? It’s possible that when you are testing it with 1 player, PlayerAdded isn’t connected before the player loads in.
I am testing it in a local server with 2 players it does work when i am testing with 1 player but not in a local server
Do the leaderstats load in when you test it with 1 player?
The leaderstats does load with 1 player and 2 players
I would try publishing this and testing it in-game rather than in studio. I see nothing wrong with your script so it should work fine if you test it in-game.
I did publish it and after a few days i found out that only 1 player in the server gets a point and others dont and thats when i decided to create this topic
Do you have this inside of a local script?
No i have this in ServerScriptStorage and it’s a script not localScript
I don’t see anything wrong except the += which I am unsure if it works on roblox…
Anyways…
Another method is to check on client when they die and fire it to the server, that would probably work, increment from there on…
Like i said in the quote it does work in lua try this script for proof
If the the leaderstats is loaded in regardless of whether it is a local server or not that means it isn’t an issue where PlayerAdded is connected after the player is loaded in. This doesn’t seem to be intended behavior so he shouldn’t have to go to such lengths.
I would try putting the script in another place and seeing if that works.
I mean zay did say that he/she was using datastores with the script, I have no idea what came before that… It’s just an alternative solution
Im gonna try to test it in my game now
If it doesn’t work could you possibly provide us your datastore code, that could be interfering with it.
So the death counter script stopped working cuz i replaced it with CharacterRemoved and kinda broke the checkpoints (yes im making an obby game)
Have you put CharacterAdded back in and tested it?
Try this:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
Death.Value = Death.Value + 1
game.ReplicatedStorage.ServerOofs.Value = ServerOofs.Value + 1
end)
end)