Hey devs,
I’m trying to make a sciript that makes you get teleported to another game apart of the current game whenever you die. I have a local script in starter character scripts but the teleport part doesnt work. If anyone could help me, I would really appreciate it!
game.Players.LocalPlayer.Character:WaitForChild('Humanoid').Died:Connect(function()
print("DIED")
local FromChar = game.Players:GetPlayerFromCharacter(game.Players.LocalPlayer.Character.Parent)
if FromChar then
local TeleService = game:GetService("TeleportService")
TeleService:Teleport(13884134530,FromChar)
end
end)
What’s the point of doing this here? You are trying to find the Player from the LocalPlayer’s Character, when you already know the player? But you are even doing that wrong by using the parent of the Character(workspace)?