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 » Scripting Helpers
Home Search
 

Re: Please help

Previous Thread :: Next Thread 
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
29 May 2013 02:33 PM
I really can't understand why this doesn't work! It used to work until I added the if statement to check whether the door is bright red! However now it doesn't print YES when I touch the brick :(

There isn't an error message and the start color of "door" is "Bright red"!

--Scripted by Robloxmaster2137
script.Parent.Touched:connect(function(child)
door = script.Parent.Parent.Door
if door.BrickColor == "Bright red" then
print("YAY")
door.BrickColor = BrickColor.new("Bright green")
for i=1,20 do
door.CFrame = door.CFrame * CFrame.new(0,0,-0.1)
wait(0.1)
end
wait(2)
for i=1,20 do
door.CFrame = door.CFrame * CFrame.new(0,0,0.1)
wait(0.1)
end
door.BrickColor = BrickColor.new("Bright red")
end
end)
Report Abuse
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
29 May 2013 02:48 PM
HELP
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 May 2013 02:50 PM
correct me if I'm wrong, but I believe it is

if part.BrickColor == BrickColor.new("Color of brick") then
Report Abuse
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
29 May 2013 02:59 PM
well I'm not sure if that's why it doesn't work! :D
Report Abuse
sTvcs is not online. sTvcs
Joined: 24 Jun 2012
Total Posts: 704
29 May 2013 03:01 PM
To compare special values such as a 3d position or a brick color, you have to create a value of that choice, usually with the name of that property (positiong being Vector3 as they are three vectors, BrickColor is self explanatory)

Remember this and you won't make this mistake again.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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