im trying to make a script that will tell you what music is playing. so the text will be the same as the status but how do i make a script that checks if status has changed? this is what i tried
local status = game.StarterGui.MusicStatus local text = script.Parent status.Value.Changed:Connect(function() text.Text = status end)
local player = game.Players.LocalPlayer local status = player.PlayerGui:WaitForChild("MusicStatus") local text = script.Parent status.Value.Changed:Connect(function() text.Text = status end)
You didn't use PlayerGui.
.Changed only works with string values. Insert a string value into ReplicatedStorage
first. You can name it Status. Then you can change its value any time. Replace your script with this (make sure it's a LocalScript as well):
local status = game.ReplicatedStorage:WaitForChild("Status") local text = script.Parent text.Text = status.Value status.Changed:Connect(function() text.Text = status.Value end)
Hope this helps!