local Song = game.Players.LocalPlayer.PlayerScripts.LocalBackgroundMusic.BGM
while true do
if Song.SoundId == "rbxassetid://1587473857" then
script.Parent.Text = ("Current Song: Chill")
end
if Song.SoundId == "rbxassetid://366682733" then
script.Parent.Text = ("Current Song: Chill2")
end
if Song.SoundId == "rbxassetid://911100428" then
script.Parent.Text = ("Current Song: idealism lonely")
end
if Song.SoundId == "rbxassetid://2240495212" then
script.Parent.Text = ("kudasai - attached")
end
if Song.SoundId == "rbxassetid://2663497976" then
script.Parent.Text = ("kudasai - sapphire")
end
if Song.SoundId == "rbxassetid://2588878861" then
script.Parent.Text = ("kudasai - serenade")
end
if Song.SoundId == "rbxassetid://2586337870" then
script.Parent.Text = ("kudasai - technicolor")
end
if Song.SoundId == "rbxassetid://4543797183" then
script.Parent.Text = ("kudasai - technicolor")
end
end
Okay this took way to long, with the old code would look through LocalBackgroundMusic to find a Member called BGM not a Child.
Hereβs the code btw: Just change the script to a Localscript
local plr = game.Players.LocalPlayer
--local Song = plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM") // -- Will index nil if used in the if-statements?
while wait() do
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://1587473857" then
script.Parent.Text = "Current Song: Chill"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://366682733" then
script.Parent.Text = "Current Song: Chill2"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://911100428" then
script.Parent.Text = "Current Song: idealism lonely"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://2240495212" then
script.Parent.Text = "kudasai - attached"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://2663497976" then
script.Parent.Text = "kudasai - sapphire"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://2588878861" then
script.Parent.Text = "kudasai - serenade"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://2586337870" then
script.Parent.Text = "kudasai - technicolor"
end
if plr.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM").SoundId == "rbxassetid://4543797183" then
script.Parent.Text = "kudasai - technicolor"
end
end
and change line 5 in Listenforchange to:
local song = game.Players.LocalPlayer.PlayerScripts.LocalBackgroundMusic:FindFirstChild("BGM")
Type
Description
Can fire to
LocalScript
For client side and to be used in PlayerBased stuff
Client and Server(Using RemoteEvents and RemoteFunctions)