Hi, so I'm working on a script which tp's one player to his base, and other to there base, how do I set so that they spawn where they need to spawn, and the script knows who goes where. Pls, give me a wiki link and/or an example, thanks! :D
To teleport players to different locations in your game, look at this guide on the wiki.
If you want to have a spawn part where players are teleported to, you can add a part to the explorer and simply reference that part in you script. That way, if you wanted to change where players spawn, you simply have to move the part.
local spawnPartOne = workspace.path.to.spawnPartOne local spawnPartTwo = workspace.path.to.spawnPartTwo local teamOne = game.Teams.path.to.teamOne local teamTwo = game.Teams.path.to.teamTwo game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("Humanoid", 5) if not humanoid then print("The humanoid wasn't found in the allowed time!") return end if player.Team == teamOne then character.HumanoidRootPart.CFrame = spawnPartOne.CFrame elseif player.Team == teamTwo then character.HumanoidRootPart.CFrame = spawnPartTwo.CFrame end end) end)
This script could be made a little nicer, but I think it shows what you want.
You can teleport people by using this service.