local stage = game:GetService("Players").LocalPlayer.leaderstats.Stage
local sound = {2629666914, 1943645778, 3094708023, 1797517374, 2559967558, 1796267247}
if game.Workspace:FindFirstChild("e") == nil then
soundObject = Instance.new("Sound",workspace)
soundObject.Name = "e"
local random1 = math.random(1,6)
soundObject.SoundId = "rbxassetid://"..sound[random1]
soundObject.Looped = true
soundObject:Play()
end
stage:GetPropertyChangedSignal("Value"):Connect(function()
if stage.Value == 1 then
soundObject:Stop()
soundObject.SoundId = "rbxassetid://"..sound[1]
soundObject:Play()
else if stage.Value == 9 then
soundObject:Stop()
soundObject.SoundId = "rbxassetid://"..sound[2]
soundObject:Play()
else if stage.Value == 21 then
soundObject:Stop()
soundObject.SoundId = "rbxassetid://"..sound[3]
soundObject:Play()
else if stage.Value == 31 then
soundObject:Stop()
soundObject.SoundId = "rbxassetid://"..sound[4]
soundObject:Play()
else if stage.Value == 41 then
soundObject:Stop()
soundObject.SoundId = "rbxassetid://"..sound[5]
soundObject:Play()
end
end
end
end
end
end)
It's really inconsistent, I keep getting Players.CrypxticDoge.PlayerGui.LocalScript:18: attempt to index nil with 'Stop'

1 comment
isnt it "Pause" not "Stop" ? i might be wrong