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

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

Asked by 5 years ago

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.

0
Is it in a server script or local script? CaptainAlien132 225 — 5y
0
localscript rylie2377 39 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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

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 Gameplayer365247v2 1055 — 5y
0
https://prnt.sc/n5lrkq -- Hope that helps rylie2377 39 — 5y
0
please accept this answer if it helps you Gameplayer365247v2 1055 — 5y
0
Look at the image link, to further help me. I will once completed. rylie2377 39 — 5y
View all comments (9 more)
0
i did look at the image and that is my script Gameplayer365247v2 1055 — 5y
0
make sure the parent of the script is a textbutton and not a textbox Gameplayer365247v2 1055 — 5y
0
https://prnt.sc/n5mff9 (It turned the screen gold rather then the neon part gold) rylie2377 39 — 5y
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 Gameplayer365247v2 1055 — 5y
0
easier said, roblox gold is that color so as i said, find another color that suits you better Gameplayer365247v2 1055 — 5y
0
ok i read what you said now properly and didnt u want the part to change color? Gameplayer365247v2 1055 — 5y
0
yea, I want the neon part to change color to gold. Not the surfacegui to change to gold. rylie2377 39 — 5y
0
you still there? rylie2377 39 — 5y
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 Gameplayer365247v2 1055 — 5y
Ad

Answer this question