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: Color & Position Change *Please help*

Previous Thread :: Next Thread 
Tidbit1 is not online. 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 is not online. 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 is not online. Tidbit1
Joined: 15 Jun 2009
Total Posts: 92
04 Aug 2012 09:30 AM
Did not work... D:
Any more help?
Report Abuse
Tidbit1 is not online. Tidbit1
Joined: 15 Jun 2009
Total Posts: 92
04 Aug 2012 09:30 AM
bump
Report Abuse
rsethc is not online. 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 is not online. 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
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