Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

The player won't teleport to another place on death?

Hello I was trying to make a script that makes it so that way when you die it will teleport you to another place/game. Can someone please help me? Heres the script I used.

function udead(whodat, whodatplr)

whodat.Humanoid.Died:connect(function()

game:GetService("TeleportService"):Teleport(3080930751)

end)

end

game.Players.PlayerAdded:connect(function(plr)

plr.CharacterAdded:wait()

udead(plr.Character,plr)

plr.CharacterAdded:connect(function(char)

udead(char,plr)

end)

end)

1 answer

✓ Accepted answer

Make sure to format your code correctly to make it easier for us to read.

TeleportService needs to pass a PlayerObject as its second parameter in order to know what player needs to be teleported. Unless you are using a local script, it will be:

game:GetService('TeleportService'):Teleport(id, playerObj)

If it still doesn't work, make sure the Died event is connected properly using prints to debug.

1 comment

0

It worked thank you so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.