|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 29 May 2013 02:59 PM |
| well I'm not sure if that's why it doesn't work! :D |
|
|
| Report Abuse |
|
|
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 |
|
|