Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
|
| 19 Nov 2014 06:34 AM |
| I created a script that teleports me to the brick in the map and it teleported me to the middle of the map, what can I do? |
|
|
| Report Abuse |
|
|
Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
|
| 19 Nov 2014 06:45 AM |
| WHY IS NO ONE TELLING ME!!!??? |
|
|
| Report Abuse |
|
|
| |
|
Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
|
| 19 Nov 2014 06:57 AM |
function tpPlayer() local getspawn = game.Workspace.Map local getchildrenr = getspawn.Red:GetChildren(workspace.Map.Red) local getchildrenb = getspawn.Blue:GetChildren(workspace.Map.Blue) local players = game.Players:GetChildren() for index, player in pairs(players) do local character = player.Character local torso = character.Torso if player.TeamColor == game.Teams.Red.TeamColor then torso.Position = Vector3.new(getchildrenr.Position) end if player.TeamColor == game.Teams.Blue.TeamColor then torso.Position = Vector3.new(getchildrenb.Position) end end end |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2014 06:58 AM |
| your getchildren r and b are wrong. |
|
|
| Report Abuse |
|
|
Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
| |
|
|
| 19 Nov 2014 07:04 AM |
you're using getChildren()
and you should be using .Spawn
find a spawn block, not all the children. |
|
|
| Report Abuse |
|
|
Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
|
| 19 Nov 2014 07:16 AM |
| That worked a little but it send me outside of the map. |
|
|
| Report Abuse |
|
|
Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
|
| 19 Nov 2014 07:17 AM |
function tpPlayer() local getspawn = game.Workspace.Map local getchildrenr = getspawn.Red if getchildrenr~=nil then local getchildrenb = getspawn.Blue if getchildrenb~=nil then local players = game.Players:GetChildren() for index, player in pairs(players) do local character = player.Character local torso = character.Torso if player.TeamColor == game.Teams.Red.TeamColor then torso.CFrame = CFrame.new(Vector3.new(getchildrenr.CFrame)) end if player.TeamColor == game.Teams.Blue.TeamColor then torso.Position = CFrame.new(Vector3.new(getchildrenb.CFrame)) end end end end end |
|
|
| Report Abuse |
|
|
Psvita567
|
  |
| Joined: 28 Sep 2014 |
| Total Posts: 861 |
|
|
| 19 Nov 2014 07:24 AM |
| Ok I changed the script now it worked nvm |
|
|
| Report Abuse |
|
|
| |
|