when I get the value of Playing its true and why won't this work
if game.Workspace.MusicScript.S1.Playing == true then script.Parent.Text = "Song: party" end
It's because it is only checking once. Do:
while true do if game.Workspace.MusicScript.S1.Playing == true then script.Parent.Text = "Song: party" end wait() end
The reason it's not working is because it need to be constantly checking, a while true loop or while wait loop would work. Example:
while wait(0.1) do if game.Workspace.MusicScript.S1.Playing == true then script.Parent.Text = "Song: party" end end
That is probably the most simple but inefficient way of doing it. It SHOULD work though!
The most efficient way is runservice (stepped) i believe, give it a try as it rely's on a roblox service and not fully on the client (won't cause memory leaks)
game:GetService("RunService").Stepped:Connect(function() game:GetService("RunService").Stepped:Wait() if game.Workspace.MusicScript.S1.Playing == true then script.Parent.Text = "Song: party" end end)
local sound = workspace:WaitForChild("MusicScript").S1 sound.Played:Connect(function() -- Connect a function once the sound starts to play script.Parent.Text = "Song: party" end)
the reason for workspace:WaitForChild is that most of the times the player and its scripts loads faster than the game itself, so only necessary in studio.