Bool Value not changing

Hey, I know those type of scripts are quite simple, But can someone explain to me why isn’t this working?
Thanks in advanced.

while true do
	game.ReplicatedStorage.MusicTitle.Value = "PinkPantheress - Break It Off" -- Break It Off
	wait (game.Workspace.Music.BreakItOff.TimeLength)
	game.ReplicatedStorage.MusicTitle.Value = "Glitter - Tyler The Creator" -- Glitter
	wait (game.Workspace.Music.Glitter.TimeLength)
	game.ReplicatedStorage.MusicTitle.Value = "Telepatia - Kali Uchis" -- Telepatia
	game.ReplicatedStorage.MusicTitle.Value = "Today - Lil Uzi Vert" -- Today
	game.ReplicatedStorage.MusicTitle.Value = "Freaks - Surf Curse" -- Freaks


Have a nice day!

From what I can see, you are creating a poorly designed music system. Use the following:

local songIDs = {} -- A table to insert your music IDs!
local sound = pathToYourSoud
while wait() do
for i = 1, #songIDs do
local finalIndex = "rbxassetid://" .. songIDs[i]
sound.SoundId = finalIndex

Thank u but i’m trying to make it so the bool value changes when the sound ends.

BoolValues can’t have a non-boolean value. You’re trying to assign a string value to a boolean value. Try switching your BoolValue to a StringValue.

I switched it into a string value and it still dosen’t work. is it because im using a local script or something?

Nope, it should work on the client assuming it’s parented to one of the instances that can run localscripts (backpack, character, playergui, playerscripts, replicatedfirst). Other players won’t be able to see it though.

Could you provide your full script?

No, it doesn’t really matter, make sure the values are either true or false, (no quotation marks or anything), change it to astring value if you’d like to store a string.

I found the solution actually. I tried putting the script in workspace and I changed it into a server script. Then the value started changing. Thanks for all the help!

1 Like