generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: This 9 liner doesn't work! No output error!

Previous Thread :: Next Thread 
Zevios is not online. 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 is not online. 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
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
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 is not online. 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 is online. 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
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image