I'm new at coding, I know very little on how to code but I have been able to create some simple scripts (walkspeed, map changing, instant respawn) so far. However I'm having trouble finding info on how to make a player respawn automatically every _ seconds. I need to do this because in the midst of map changing the player falls into the void and dies. Thanks!
Use a loop (http://wiki.roblox.com/index.php?title=Loops) Here's an example.
while wait(5) do game.Players.Player1:LoadCharacter() end
local player = "mamaluigi1234" -- Change to the name of the player local seconds = 60 -- Change to how many seconds between respawns while true do wait(seconds) if game.Players[player] then game.Players[player]:LoadCharacter() end end
game.Players.PlayerAdded:Connect(function(player) while wait(5) do -- changed 5 to whatever time you need player:LoadCharacter() end end)
Closed as Not Constructive by farrizbb, DeceptiveCaster, Amiaa16, Troidit, cmgtotalyawesome, User#20388, Programical, and minikitkat
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?