Need help with timed script

Hello! I want to make a script which will make, player respawn after time Is out l just want all players In my game to get respawned every 10 seconds. The Issue Is very simple, I have tried unnecessary things, to solve my problem but, solutions that I have tried didn’t seem to work at all. I haven’t looked In another Developer forums, I think that I can get enough help here from experienced people than me.

The script that I have tried

> game.Players.RespawnTime = 0.5

I am slightly confused on what you want to do. If you mean you want them to respawn every 10 seconds, you should use this:

game.Players.PlayerAdded:Connect(function(player)
    while true do
        wait(10)
        player:LoadCharacter()
    end
end)
2 Likes

Instead, you would disable the auto-respawn for the game instead and write a custom spawn logic like the aforementioned. However, this should be based on the timer and whenever a certain variable(e.g. canRespawn) is turned true or not.

API reference here:

When the timer expires, the variable is flicked and a function that should respawn the players available in the game. Simply by using Player:LoadCharacter().

2 Likes