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

Why won't my surfacegui script change a bricks color in workspace?

I'm trying to have the surfacegui change the neon bricks color, so I implemented this script, however it is not changing the bricks color from white to gold. here is the script:

function onClick(clicked)

game.Workspace.DanceFloor.Light1.BrickColor = BrickColor.new("Gold") script.Parent.MouseButton1Down:connect(clicked)

https://prnt.sc/n5l3at --the link is for a visualization of what im trying to do.

2 comments

0

Is it in a server script or local script?

0

localscript

1 answer

✓ Accepted answer

put the script inside the gui make it a server script (normal script) and do this instead

script.Parent.MouseButton1Click:Connect(function()--activates the function once you click
script.Parent.Parent.Parent.Parent.BrickColor = BrickColor.new("Gold")--changes the brickcolor to gold
end)

the picture you provided did help

13 comments

0

if this dont work then send a screenshot of the workspace so i can see your layout and help you better, as of right now im very blind

0

https://prnt.sc/n5lrkq -- Hope that helps

0

please accept this answer if it helps you

0

Look at the image link, to further help me. I will once completed.

0

i did look at the image and that is my script

0

make sure the parent of the script is a textbutton and not a textbox

0

https://prnt.sc/n5mff9 (It turned the screen gold rather then the neon part gold)

0

you typed gold on your script so i gave you that color, i didnt change anything check up what color fits you the best and replace the gold with that color name

0

easier said, roblox gold is that color so as i said, find another color that suits you better

0

ok i read what you said now properly and didnt u want the part to change color?

0

yea, I want the neon part to change color to gold. Not the surfacegui to change to gold.

0

you still there?

0

i am now but u need to find the parent you want to change, i wrote 4 parents because the fourth parent is the part

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