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: Whats wrong with this?

Previous Thread :: Next Thread 
joe199998293 is not online. joe199998293
Joined: 12 May 2009
Total Posts: 733
04 Aug 2012 10:30 AM
Whats wrong with this?

function onClicked()
.ColourHere = ("Bright green")
game.workspace.Walkway.Lights.A.BrickColor = BrickColor.new.ColourHere
game.workspace.Walkway.Lights.B.BrickColor = BrickColor.new.ColourHere
game.workspace.Walkway.Lights.C.BrickColor = BrickColor.new.ColourHere
game.workspace.Walkway.Lights.D.BrickColor = BrickColor.new.ColourHere
game.workspace.Walkway.Lights.E.BrickColor = BrickColor.new.ColourHere
game.workspace.Walkway.Lights.F.BrickColor = BrickColor.new.ColourHere
game.workspace.Walkway.Lights.G.BrickColor = BrickColor.new.ColourHere
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
04 Aug 2012 10:32 AM
First in the variable you should remove the ".". Second the variable should be set like this:

ColourHere = BrickColor.new("Bright green")
Report Abuse
rsethc is not online. rsethc
Joined: 23 Jan 2011
Total Posts: 333
04 Aug 2012 10:34 AM
ColourHere = ("Bright green")
function onClicked()
game.workspace.Walkway.Lights.A.BrickColor = ColourHere
game.workspace.Walkway.Lights.B.BrickColor = ColourHere
game.workspace.Walkway.Lights.C.BrickColor = ColourHere
game.workspace.Walkway.Lights.D.BrickColor = ColourHere
game.workspace.Walkway.Lights.E.BrickColor = ColourHere
game.workspace.Walkway.Lights.F.BrickColor = ColourHere
game.workspace.Walkway.Lights.G.BrickColor = ColourHere
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
joe199998293 is not online. joe199998293
Joined: 12 May 2009
Total Posts: 733
04 Aug 2012 10:34 AM
function onClicked()
ColourHere = BrickColor.new("Bright green")
game.workspace.Walkway.Lights.A.BrickColor = ColourHere
game.workspace.Walkway.Lights.B.BrickColor = ColourHere
game.workspace.Walkway.Lights.C.BrickColor = ColourHere
game.workspace.Walkway.Lights.D.BrickColor = ColourHere
game.workspace.Walkway.Lights.E.BrickColor = ColourHere
game.workspace.Walkway.Lights.F.BrickColor = ColourHere
game.workspace.Walkway.Lights.G.BrickColor = ColourHere
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

This Works. Thanks!
Report Abuse
rsethc is not online. rsethc
Joined: 23 Jan 2011
Total Posts: 333
04 Aug 2012 10:36 AM
Color = ("Bright green")
model = game.Workspace.Walkway.Lights
a = model.A
b = model.B
c = model.C
d = model.D
e = model.E
f = model.F
function onClicked()
a.BrickColor,b.BrickColor,c.BrickColor,d.BrickColor,e.BrickColor,f.BrickColor=Color,Color,Color,Color,Color,Color
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
rsethc is not online. rsethc
Joined: 23 Jan 2011
Total Posts: 333
04 Aug 2012 10:36 AM
Optimized for less memory leak.
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
04 Aug 2012 10:39 AM
^_^
......
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