Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

SurfaceGui brick color changer?

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

✓ Accepted answer

Line 3:

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

-- I think this should work

11 comments

0

And what if I it to change to a Neon Green?

0

Doesn't matter. It should change to a Random colour. If it stays Neon Green, the server chose Neon Greem at random.

0

I ment I want it so when you click the button it stays turns to green and not a random

0

Then I don't really know the script. Sorry.

0

Thanks for the help, I figured it out :D

0

Alright I got it working but do you know how i can change the PointLight color inside the brick?

0

Err, a few more details please?

0

brick.SurfacePart.Lights.LightPart1.PointLight = Color.new(0, 255, 0) I need the PointLight inside the brick to change to 0,255,0

0

brick.SurfacePart.Lights.LightPart1.PointLight.Color = Color3.new(0,255,0) --That should work I think.

0

Thanks!

0

Glad to help

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

1 comment

0

mk

This discussion is preserved as it was. New answers, comments, and votes are closed.