I'm trying to figure out what's wrong with my script and why it's not removing the sound script as well as not changing the walkspeed within the Player after they respawn. Any help?
function onPlayerEntered(player)
repeat wait () until player.Character ~= nil
Player.Character.Sound:Destroy()
Player.Character.Humanoid.WalkSpeed = 5
player.CharacterAdded:connect(function (char)
Player.Character.Sound:Destroy()
Player.Character.Humanoid.WalkSpeed = 5
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered)

1 comment
But when the player respawns the sound comes back again.