The blue should be a teleporter if stepped on. The yellow should be where the players should be teleported to. My only problem I'm having is that I have 2 teams. "Stage3" and "Checkpoint1" Stage3 is below the blue platform, I don't want it to teleport them to Checkpoint1, Checkpoint1 should be able to teleport them to that same yellow box area.
✓ ANSWER ACCEPTED
How could I make a teleport script based on their team?
1 answer
✓ Accepted answer
so if you want to teleport people based on their team you can do
if player in team1 then
teleport the player to the place you want it to be at
elseif player in team 2 then
teleport the player to a different location
end
how you get the team is game.players.localplayer.Team so it would be
if game.players.localplayers == blue then
teleport player
end
do
game.Workspace.Part.Touched:Connect(function(hit)
if game.Players.LocalPlayer.Team == game.Teams.Blue then
hit.Parent:moveTo(game.Workspace.Part.Position + Vector3.new(0,3,0))
elseif game.Players.LocalPlayer.Team == game.Teams.Red then
hit.Parent:moveTo(game.Workspace.Part.Position + Vector3.new(0,3,0))
end
end)
THESCRIPT:
local debounce = true
script.Parent.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent).Team == game.Teams.Blue then
if hit.Parent:FindFirstChild("Humanoid") then
if debounce then
hit.Parent:moveTo(game.Workspace.Partabc.Position + Vector3.new(0,3,0))
wait(0.5)
debounce = true
end
end
end
end)
you can copy this script directly into a regular script into the blue part
This discussion is preserved as it was. New answers, comments, and votes are closed.

16 comments
hope this helped!
sorry i dont know anything about scripting, i'm just a builder trying to make this happen. i don't know what to add on to the first script and do i make 2 scripts for both of those?
replace game.workspace.part with where it is and same with game.teams.blue
doesn't seem to be working for me, i put that script into the part where i want it to teleport and nothing seems to do anything. i just go through it without getting teleported
so to make it be paste -able you need to tell me the names of the parts (the names should be unique) and give me the names of the team and the script should be a local script inside of starter pack not the brick
the team names are "Stage3" (which is below the blue teleport if you look at the screenshot) and "Checkpoint1" (where the yellow box area is in the screenshot) note: i don't want Stage3 to teleport at all they should be able to pass through the blue platform, only Checkpoint1 should be able to teleport. The blue teleport platform is just called "Trigger1"
wait the team names are stage3 and checkpoint1? is stage3 a team or a part?
Stage3 is a team
is it the only team there?
https://puu.sh/FTOwT.png seen here, yellow box area is Checkpoint1 team, red box area is Stage3 team, blue platform is Trigger1 part.
wait that is what u want it to do? if it is ok that if when ever you stand on the blue part you die you can make it so they are spawnpoints and the blue part has a killscript i'll edit my answer to show u the kill script
to make it a spawnpoint add spawnpont to workspace and replace the block completely with it do the same for the other part then go to properties go all the way down to teams then change the team color to the teams color unselect neutral
then if you want it to change the teams color if you step on it to that color then select allowteamchangeontouch
no, i don't want the player to be killed. all i need is if the player is in stage3, nothing happens to them they continue on. but once they Checkpoint1, then the blue platform will be able to teleport them back to the chekpoint if they fall down.
ok making the script right now...
if i remove all of my comments it will make u look crazy >:)