This is suppose to make the creator of the game go to the creator spawn and the creators friends go to the friend spawn when they die or join the game. I have the creator spawn named "CreatorSpawn" and the friend spawn named "FriendSpawn" but the script doesn't work. Please help.
local CreatorSpawn = Workspace:FindFirstChild("CreatorSpawn") --Find the CreatorSpawn local FriendSpawn = Workspace:FindFirstChild("FriendSpawn") --Find the FriendSpawn Game.Players.PlayerAdded:connect(function(Player) --When they join if Player.userId == Game.CreatorId then --If they are the creator Player.CharacterAdded:connect(function(Character) Character:MoveTo(CreatorSpawn.Position) --Teleport them to the CreatorSpawn when they spawn. end) elseif Player:IsFriendsWith(Game.CreatorId) then --Otherwise if they are friends with the creator Player.CharacterAdded:connect(function(Character) Character:MoveTo(FriendSpawn.Position) --Teleport them to the FriendSpawn. end) end end)
local CreatorSpawn = Workspace:FindFirstChild("CreatorSpawn") --Find the CreatorSpawn local FriendSpawn = Workspace:FindFirstChild("FriendSpawn") --Find the FriendSpawn Game.Players.PlayerAdded:connect(function(Player) --When they join if Player.userId == Game.CreatorId then --If they are the creator Player.CharacterAdded:connect(function(Character) Character:MoveTo(CreatorSpawn.Position) --Teleport them to the CreatorSpawn when they spawn. end) elseif Player:IsFriendsWith(Game.CreatorId) then --Otherwise if they are friends with the creator Player.CharacterAdded:connect(function(Character) Character.Character:MoveTo(FriendSpawn.Position --changed this line end) end end)
Pretty simple. The Character in the line I change is just the Player in game.Players. You need to get the character by using Character.Character:MoveTo...