✓ Accepted answer
Hello it seems you are trying to change the color of a part with a script in workspace according to the Gui's text, so unless it was initially "PlayBackLoudness:10" it would change the brickcolor. So what I suggest is you put that script in a localscript in the Gui and get the part from the workspace instead.
something like this:
local the_part = workspace:FindFirstChild("nameofpart")
while true do
wait(0.1)
if script.Parent.music.MainFrame.PBL.Text == "PlayBackLoudness:10" then
the_part.BrickColor = BrickColor.Random()
end
end
The reason why that won't work is because the Gui in StarterGui will not change from how you initialized it, it only gets cloned to the players. When players enter the game they have their own "folders" under the Players section where the Guis in StarterGui gets cloned to their PlayerGui. So if you want interaction between the workspace and the Gui, most preferably you use a localscript because the localscript run for each player. So in this case, a localscript running in each player's Gui
8 comments
18:02:00.138 - Players.JustSxript.PlayerGui.LocalScript:4: 'then' expected near '='
if script.Parent.music.MainFrame.PBL.Text >>>=<<< "PlayBackLoudness:10" The = wont work, no clue why
Oh yeah, sorry, I've edited it now :) just added then
Woops I edited again!!! you have to use double '=='
its the other "="xd (next to text)
never mind i'll accept it when it works , testing it out now.
if script.Parent.music.MainFrame.PBL.Text == "PlayBackLoudness:10" then wont work?
thanks, its working c: