Tidbit1
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 92 |
|
|
| 03 Aug 2012 09:44 PM |
So here's the deal; I have a block called "Light". Light changes color between Mid Gray, Bright Blue, and Bright Red. Now, my objective is to have it so a block called "Head" will change position upon the color change of Light, each color having a specific position. Light has two different scripts, the one that lets it change color and then one I struggle with. Light and Head both exist in a model called "TheCanopy". Here is my script, I think I'm close: function touched(hit)
if game.Workspace.TheCanopy.Light.BrickColor == BrickColor.new("Bright Blue") then game.Workspace.TheCanopy.Head.Vector3.new(188.5, 262, -129) end if game.Workspace.TheCanopy.Light.BrickColor == ("Bright Blue") == false then end
if game.Workspace.TheCanopy.Light.BrickColor == BrickColor.new("Bright Red") then game.Workspace.TheCanopy.Head.Vector3.new(179.5, 262, -129) end if game.Workspace.TheCanopy.Light.BrickColor == ("Bright Blue") ==false then end
end
script.Parent.Touched:connect(touched)
Output says nothing (big help, huh?) and it does not work. This is rather important as it's for my group. If there's a problem, please fix it, post it, and tell me why, if you'd be so kind.
Thanks to all of those that help me, -Tidbit1 |
|
|
| Report Abuse |
|
|
human
|
  |
| Joined: 06 May 2007 |
| Total Posts: 2765 |
|
|
| 03 Aug 2012 09:53 PM |
--edit game.Workspace.TheCanopy.Head.CFrame = CFrame.new(188.5, 262, -129)
--edit game.Workspace.TheCanopy.Head.CFrame = CFrame.new(179.5, 262, -129)
|
|
|
| Report Abuse |
|
|
Tidbit1
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 92 |
|
|
| 04 Aug 2012 09:30 AM |
Did not work... D: Any more help? |
|
|
| Report Abuse |
|
|
Tidbit1
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 92 |
|
| |
|
rsethc
|
  |
| Joined: 23 Jan 2011 |
| Total Posts: 333 |
|
|
| 04 Aug 2012 10:22 AM |
--original function touched(hit)
if game.Workspace.TheCanopy.Light.BrickColor == BrickColor.new("Bright Blue") then game.Workspace.TheCanopy.Head.Vector3.new(188.5, 262, -129) end if game.Workspace.TheCanopy.Light.BrickColor == ("Bright Blue") == false then end
if game.Workspace.TheCanopy.Light.BrickColor == BrickColor.new("Bright Red") then game.Workspace.TheCanopy.Head.Vector3.new(179.5, 262, -129) end if game.Workspace.TheCanopy.Light.BrickColor == ("Bright Blue") ==false then end
end
script.Parent.Touched:connect(touched)
---------- Problems: BrickColor module new function returns the BrickColor "Medium stone grey" when its argument isn't valid.
Did you mean BrickColor.new("Bright blue") and BrickColor.new("Bright red")?
I'm going to rewrite this so it loops endlessly. I don't know if that setup helps you but whatever... ---------- WaitTime = 1 function loop() Light.BrickColor = BrickColor.new("Bright red") Head.CFrame = CFrame.new(179.5,262,-129) wait(waitTime) Light.BrickColor = BrickColor.new("Bright blue") Head.CFrame = CFrame.new(188.5,262,-129) wait(waitTime) end while true do loop() end |
|
|
| Report Abuse |
|
|
Tidbit1
|
  |
| Joined: 15 Jun 2009 |
| Total Posts: 92 |
|
|
| 04 Aug 2012 11:27 AM |
| Sorry, but you must have not read my situation very well. I don't want it on a timer. |
|
|
| Report Abuse |
|
|