Hey there, im trying to make a lyrics script for a radio for specific songs. However, the boolean values just wont change or anything. Any help is appreciated
Script:
local Radio = script.Parent:FindFirstChild("MusicPlayer")
local nobody = script.Parent:WaitForChild("nobodyCaresEnoughToCallSong")
local siren = script.Parent:WaitForChild("sirenSong")
local nobodyscript = script.Parent:FindFirstChild("NobodyCaresEnoughtoCall")
local sirenscript = script.Parent:FindFirstChild("Siren")
siren.Value = false
nobody.Value = false
Radio.CurrentSong:GetPropertyChangedSignal("SoundId"):Connect(function()
siren.Value = false
nobody.Value = false
if Radio.CurrentSong.SoundId == "rbxassetid://14325970850" then
siren.Value = true
print("Enabled Siren")
task.wait(Radio.CurrentSong.TimeLength)
siren.Value = false -- Disable Siren after waiting for the sound to finish
elseif Radio.CurrentSong.SoundId == "rbxassetid://14326066603" then
nobody.Value = true
print("Enabled NobodyCaresEnoughtoCall")
task.wait(Radio.CurrentSong.TimeLength)
nobody.Value = false -- Disable NobodyCaresEnoughtoCall after waiting for the sound to finish
end
end)
Radio.CurrentSong.Ended:Connect(function()
siren.Value = false
nobody.Value = false
end)
You said the booleans aren’t changing but do you hear any sound?
Do the sounds change at all?
You also said "The only thing thats printed it “song started” and “Enabled (song)” but I don’t see anywhere in this script that says print("song started").
Try:
Radio.CurrentSong:GetPropertyChangedSignal("SoundId"):Connect(function()
print(CurrrentSong.SoundID) --to see if you're getting the number you expect.
Another thing, what is changing the CurrentSong.SoundId to cause the first function to fire? There’s nothing in this script that changes the SoundId to cause the function to fire.
Um…
You don’t :Play() the songs in this script, you just change the boolvalues.
Do you play the songs in the other script? If so why not just change the boolvalues and wait times there?