Scripting Issue

I’m having a problem with this script, basically when a player clicks a button it teleports them into a map. Whenever they die they will spawn back into the map but not with Spawn Locations but with specific coordinates. But the problem is that when the Player dies it doesn’t send the Player back to the Map.

You can check the script right below here.

         print(“Player has died”)
     if random == 1 then
      print(“Default 1”)
      player.Character.HumanoidRootPart.CFrame =, 
      74.652, 165.87)
    elseif random == 2 then
      print(“Default 2”)
       player.Character.HumanoidRootPart.CFrame =, 
      73.652, 19.058)
  elseif random == 3 then
     print(“Default 3”)
     player.Character.HumanoidRootPart.CFrame =, 73.652, -187.531)
 elseif random == 4 then
        print(“Default 4”)
        player.Character.HumanoidRootPart.CFrame =, 
   73.652, -47.832)
   elseif random == 5 then
            print(“Default 5”)
            player.Character.HumanoidRootPart.CFrame = 

This is in a Local Script.

1 Like

It’s most likely due to the fact that when the Player dies, their PlayerGui is reset – therefore killing the script and it never fires. You can very well convert this script into a Server script for the same effect and it should fire.

Just wrap the code inside of a:

-- your code here