of     2   
chevron_rightchevron_rightchevron_right

newjersey00
#35515552Saturday, October 16, 2010 1:11 PM GMT

can someone help me finish this script please. just a little info on what im trying to do, i want a button that when i press it, the brick changes colour from eg red to green, then back function onClicked() if workspace.(BRICKNAME).Value.Value == true then workspace.BrickNAME.Color = Color3.new(#,#,#) --experiment with different numbers here end if workspace.BRICKNAME.Value.Value == false then workspace.BRICKNAME.Color = Color3.new(#,#,#) end end then a connection line i dont know please help me!
lasassin
#35517122Saturday, October 16, 2010 1:54 PM GMT

My example for a button containing a ClickDetector: ------------------------------------------------------------------ brick = game.Workspace.BRICKNAME function onClick() if brick.Color = Color3(255,0,0) then --Is the button red? brick.Color = Color3.new(0,255,0) --Make it green end if brick.Color = Color3(0,255,0) then --Is the button green? brick.Color = Color3.new(255,0,0) --Make it red end end script.Parent.ClickDetector.MouseClick:connect(onClick) ------------------------------------------------------------------ That is how I would do it, I'm not sure if it works, I haven't tried something like this before. The brick color would have to be pure red for this to work though, I'm not sure how to do it using BrickColor.
newjersey00
#35517407Saturday, October 16, 2010 2:01 PM GMT

ahh thanks ill try it and tell you what happens
newjersey00
#35517603Saturday, October 16, 2010 2:05 PM GMT

unfortunately, it didnt work, i think it needed of some kind of connector
ApricotStyles
#35518189Saturday, October 16, 2010 2:17 PM GMT

brick.BrickColor = BrickColor.new("Bright red") eccact name from the brick colors tab there. like: brick.BrickColor = BrickColor.new("Lime green") wait(0.1) brick.BrickColor = BrickColor.new("Really red")
ApricotStyles
#35518284Saturday, October 16, 2010 2:19 PM GMT

lassasin's wouldn't work. He said: "if brick.Color = Color.new(255, 0, 0)" something like that... But we know, for IF statements you always need two '='s. And I'm not sure, but I dont think you can do "brick.Color". At least, I have never tried.
ApricotStyles
#35518544Saturday, October 16, 2010 2:24 PM GMT

lets pretend the brick's name is "Party". function onClicked() if Workspace.Party.Value.Value == true then Workspace.Party.BrickColor = BrickColor.new("Lime green") elseif Workspace.Party.Value.Value == false then workspace.Party.BrickColor = BrickColor.new("Bright red") end end end script.Parent.ClickDetector.MouseClick:connect(onClicked) try that. Of course you might need to tweek it, because I dont know what you really want for everything, or how your using this script.
newjersey00
#35519764Saturday, October 16, 2010 2:48 PM GMT

it didnt worked, what im trying to do is that i want a system where when i press a button, the bricks turn to some colours eg green to red, not the button itself, but another brick
newjersey00
#35519889Saturday, October 16, 2010 2:51 PM GMT

just like a bulb, you press a swithc, the bulb turns on, however the bulb here is a brick but it changes colour
ApricotStyles
#35521990Saturday, October 16, 2010 3:28 PM GMT

Well you didn't necessarily tell me that now did you. Plus, I said tweak it, I'm not making a script for you, I'm helping you.
newjersey00
#35525104Saturday, October 16, 2010 4:25 PM GMT

ok i made a script and tested it, but it still didnt worked local switch = script.Parent local light function onClicked() if Workspace.light.Value.Value == true then Workspace.light.BrickColor = BrickColor.new("Lime green") else if Workspace.light.Value.Value == false then end end end script.Parent.ClickDetector.MouseClick:connect(onClicked) local switch = script.Parent local light function onClicked() if Workspace.light.Value.Value == true then Workspace.light.BrickColor = BrickColor.new("Really red") else if Workspace.light.Value.Value == false then end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
newjersey00
#35575304Sunday, October 17, 2010 9:56 AM GMT

bump
trappingnoobs
#35575325Sunday, October 17, 2010 9:58 AM GMT

Lasassin's wouldn't work anyway, it'd change to green but within a frame change back to red, use elseif instead.
lasassin
#35575400Sunday, October 17, 2010 10:06 AM GMT

Yeah I realised mine wouldn't work, since I forgot to use == instead of =, and I guess my mind was stuck on making smoke and stuff with the .Color That should be .BrickColor shouldn't it...
trappingnoobs
#35575459Sunday, October 17, 2010 10:11 AM GMT

brick.Color = Color3.new(0,255,0) --Make it green elseif brick.Color == Color3(0,255,0) then --Is the button green? :/
newjersey00
#35575540Sunday, October 17, 2010 10:17 AM GMT

apparently, none of them works, wow i couldnt believe that making a simple switch that makes a brick change colour can be difficult
pauljkl
#35575592Sunday, October 17, 2010 10:21 AM GMT

This work? brick = game.Workspace.BRICKNAME function onClick() if brick.BrickColor == BrickColor.new(21) then brick.BrickColor = BrickColor.new(28) --Make it green end if brick.BrickColor == BrickColor.new(21) then brick.BrickColor = BrickColor.new(28) end end script.Parent.ClickDetector.MouseClick:connect(onClick)
newjersey00
#35575639Sunday, October 17, 2010 10:25 AM GMT

sadly no...
lasassin
#35575666Sunday, October 17, 2010 10:28 AM GMT

Yeah I have to agree with you newjersey00, this is surprisingly hard for such a simple task. But that's what coding is pretty much about right? :P
newjersey00
#35575693Sunday, October 17, 2010 10:29 AM GMT

yes its quite right, although i think some coding are missing, which inhibits us to finish this task
07lchris
#35575788Sunday, October 17, 2010 10:34 AM GMT

script.Parent.ClickDetector.MouseClick:connect(function(onClicked) if script.Parent.BrickColor == BrickColor.new("Lime green") then script.Parent.BrickColor = BrickColor.new("Really red") elseif script.Parent.BrickColor == BrickColor.new("Really red") then script.Parent.BrickColor = BrickColor.new("Lime green") end end)
newjersey00
#35575943Sunday, October 17, 2010 10:44 AM GMT

yes! it worked, now i need to make a switch for it
[rfa#hidefromsearch]
#35576065Sunday, October 17, 2010 10:52 AM GMT

[rfa#hidefromsearch]
lasassin
#35576168Sunday, October 17, 2010 10:59 AM GMT

@sircfenner Yeah I forgot that :D I made my script at like 11 pm, so my brain wasnt really working too well :P
newjersey00
#35577137Sunday, October 17, 2010 11:43 AM GMT

ok i made a switch for them and a script script.Parent.ClickDetector.MouseClick:connect(myfunction) script.Parent.ClickDetector.MouseClick:connect(function(onClicked) script.Parent.Lighty123 if script.Parent.Lighty123 == BrickColor.new("Lime green") then script.Parent.Lighty123 = BrickColor.new("Really red") elseif script.Parent.Lighty123 == BrickColor.new("Really red") then script.Parent.Lighty123 = BrickColor.new("Lime green") end end) however, no suporise to me, it didnt worked 0.o, can anyone help me on this. Btw the "Lighty123" bit is the brick that changes colour

    of     2   
chevron_rightchevron_rightchevron_right