I'm completely confused on why my script will not work. I've tried changing the variables, but it just won't work.
wait()
local l = game.Players.LocalPlayer:WaitForChild("leaderstats").Level
local t = game.Players.LocalPlayer:WaitForChild("PlayerGui").Level.LevelName.Text
script.Level1:Play()
l:GetPropertyChangedSignal("Value"):Connect(function()
if l.Value == 2 then
script.Level1:Stop()
script.Level2:Play()
t = "Level 2"
else if l.Value == 3 then
script.Level2:Stop()
script.Level3:Play()
t = "Level 3"
end
end
end)
This LocalScript that has this code is in StarterPlayerScripts. In this code, I'm confused about the text changing, not the sound playing/stopping.

1 comment
Ah, that makes sense now. Thanks!