Hello,
I am making a game with 14 different white colored teams. Each team will have a personal "room" and I would like to teleport each player when they join the game to their respective rooms.
Each "room" is a model under workspace named "Room1", "Room2" etc. Under each group is a part named TelePart, which is where I want to teleport the player. Therefore, team 1 named "Room#1" corresponds to room 1 named "Room1".
Here is what I have written so far, but it doesn't seem to work...
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local RoomTeam = player.Team.Name
local RoomNum = string.gsub(RoomTeam, "#", "")
local Room = game:FindFirstChild(RoomNum)
local TelePart = Room.TelePart
player.CameraMaxZoomDistance = 25
player:LoadCharacter()
player:MoveTo(TelePart)
end)
Error : 21:47:21.554 - ServerScriptService.JoinConfig:7: attempt to index nil with 'TelePart'
Thanks in advance!

2 comments
your error it's because you put game:FindFIrstChild instead of game.Workspace or game:GetService("Workspace) or workspace
Thank you, but the "MoveTo" part is still not working...