I was working on a function where when a player joins, it checks to see if the value of a number value is equal to a certain number. And if it is, it will do a function. But for some reason it doesn’t even check anything. Here’s the code:
game.Players.PlayerAdded:Connect(function(player)
player:WaitForChild("Settings").MusicToggle.Changed:Connect(function()
if player.Settings.MusicToggle.Value == 0 then
workspace:WaitForChild("Relax").Volume = 0
player:WaitForChild("PlayerGui").Settings.Setting.Music.On:TweenPosition(UDim2.new(0.45, 0,0, 0), nil, nil, 0.3)
player:WaitForChild("PlayerGui").Settings.Setting.Music.On.Visible = false
player:WaitForChild("PlayerGui").Settings.Setting.Music.Off.Visible = true
player:WaitForChild("PlayerGui").Settings.Setting.Music.Off:TweenPosition(UDim2.new(0.45, 0,0, 0), nil, nil, 0.3)
end
end)
end)
end)