Zevios
|
  |
| Joined: 14 Sep 2013 |
| Total Posts: 504 |
|
|
| 18 Nov 2016 10:41 AM |
script.Parent.Touched:connect(function(hit) local player = game.Players:FindFirstChild(hit.Parent.Name) if player then if player.TeamColor == "Bright green" then local torso = player:findFirstChild("Torso") torso.Position = Vector3.new(1.166, 4.533, -120.498) end end end)
Help is appreciated once again |
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 18 Nov 2016 10:46 AM |
Try debugging it on your own
for example:
script.Parent.Touched:connect(function(hit) local player = game.Players:FindFirstChild(hit.Parent.Name) if player then print ("Found player!") if player.TeamColor == "Bright green" then orint ("Player's team is Bright Green!") local torso = player:findFirstChild("Torso") if torso then print ("Found torso!") torso.Position = Vector3.new(1.166, 4.533, -120.498) end end end end)
You should be able to find where it breaks on your own. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2016 10:47 AM |
script.Parent.Touched:connect(function(hit) local player = game.Players:FindFirstChild(hit.Parent.Name) if player then if player.TeamColor == "Bright green" then local character = player.Character local torso = character:findFirstChild("Torso") torso.Position = Vector3.new(1.166, 4.533, -120.498) end end end)
|
|
|
| Report Abuse |
|
|
RogueMage
|
  |
| Joined: 28 Jan 2012 |
| Total Posts: 1235 |
|
|
| 18 Nov 2016 10:47 AM |
| Fix that "orint" and make it "print" |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 18 Nov 2016 11:04 AM |
TeamColor is a brickcolor. In this case, you're comparing a brickcolor with a string. Replace it with this:
if player.TeamColor == BrickColor.new("Bright green") |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2016 11:06 AM |
oh didnt notice that heres the completely correct script
script.Parent.Touched:connect(function(hit) local player = game.Players:FindFirstChild(hit.Parent.Name) if player then if player.TeamColor == BrickColor.new("Bright green") then local character = player.Character local torso = character:findFirstChild("Torso") if torso then torso.Position = Vector3.new(1.166, 4.533, -120.498) print("teleported yay") end end end end)
|
|
|
| Report Abuse |
|
|