What's wrong with this script?
The script is supposed to make the creator of the game spawn on the creator's spawn and friends on their spawn, but it doesn't work.
01 | local CreatorSpawn = Workspace:FindFirstChild( "CreatorSpawn" ) |
02 | local FriendSpawn = Workspace:FindFirstChild( "FriendSpawn" ) |
03 | Game.Players.PlayerAdded:connect( function (Player) |
04 | if Player.userId = = Game.CreatorId then |
05 | Player.CharacterAdded:connect( function (Character) |
06 | Character:MoveTo(CreatorSpawn.Position) |
08 | elseif Player:IsFriendsWith(Game.CreatorId) then |
09 | Player.CharacterAdded:connect( function (Character) |
10 | Character:MoveTo(FriendSpawn.Position) |