Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

SurfaceGui brick color changer?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

I have a SurfaceGui button and when I click the button, I need multiple parts in a model to change colors.

function Clicked()
brick = script.Parent
brick.Parent.Parent.Lights.LightPart1 = BrickColor.random()
wait(0.5)
end

script.Parent.MouseButton1Down:connect(Clicked)

This dose not work, Help?

2 answers

Log in to vote
-1
Answered by 10 years ago

Line 3:

--Line 3
brick.Parent.Parent.Lights.LightPart1.BrickColour = BrickColor.random()

-- I think this should work
0
And what if I it to change to a Neon Green? NotSoNorm 777 — 10y
0
Doesn't matter. It should change to a Random colour. If it stays Neon Green, the server chose Neon Greem at random. fahmisack123 385 — 10y
0
I ment I want it so when you click the button it stays turns to green and not a random NotSoNorm 777 — 10y
0
Then I don't really know the script. Sorry. fahmisack123 385 — 10y
View all comments (7 more)
0
Thanks for the help, I figured it out :D NotSoNorm 777 — 10y
0
Alright I got it working but do you know how i can change the PointLight color inside the brick? NotSoNorm 777 — 10y
0
Err, a few more details please? fahmisack123 385 — 10y
0
brick.SurfacePart.Lights.LightPart1.PointLight = Color.new(0, 255, 0) I need the PointLight inside the brick to change to 0,255,0 NotSoNorm 777 — 10y
0
brick.SurfacePart.Lights.LightPart1.PointLight.Color = Color3.new(0,255,0) --That should work I think. fahmisack123 385 — 10y
0
Thanks! NotSoNorm 777 — 10y
0
Glad to help fahmisack123 385 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

It's because you have to use a converter script, to convert your BrickColor into Color3. GUIs only work on Color3.

0
mk NotSoNorm 777 — 10y

Answer this question