Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why will the sound PanicSong not play?

No sound will play. I have 19 rebirths.

local plr = game.Players.LocalPlayer
local rebirths = plr.leaderstats.Rebirths

if rebirths <= 2 then
	game.Workspace.Audios.NoobSong:Play()
	
end

if rebirths <= 10 and rebirths >= 2 then
	game.Workspace.Audios.ChillSong:Play()
	
end
	
if rebirths <= 50 and rebirths >= 10 then
	game.Workspace.Audios.PanicSong:Play()
	
end
	
if rebirths >= 50 then
	game.Workspace.Audios.FinalCalmSong:Play()

end

3 comments

1

D o n ‘ t w a t c h A l v i n B l o x

0

I get this error: Players.MinecraftButterfly87.PlayerGui.SoundTrigger:4: attempt to compare userdata and number

0

I wasn't watching AlvinBlox.

1 answer

You forgot to add .Value after your variable rebirths.

-- So instead of looking like this:
if rebirths <= 2 then

-- Add .Value to each one instead:
if rebirths.Value <= 2 then

Or alternatively include .Value in your variable. This way you won't need to change each one individually

local rebirths = plr.leaderstats.Rebirths.Value

3 comments

0

/\ I forgot about this lmao

0

Didn't work for me.

0

What error are you getting?

This discussion is preserved as it was. New answers, comments, and votes are closed.