Can someone help me figure out how to force respawn a player if I removed them?
So basically this script removes the player:
local Player = game.Players.LocalPlayer.Character
function onButtonClicked()
game.Players.CharacterAutoLoads = false
Player.Humanoid.Health = 0
script.Parent.Parent.Parent.MenuButton.Visible = false
script.Parent.Parent.Parent.Menu.Visible = true
Player.Humanoid.Died:Connect(function()
Player:Remove()
end)
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
and I'm trying to figure out if a player presses play, it respawns them
local Player = game.Players.LocalPlayer.Character
function onButtonClicked()
game.Players.CharacterAutoLoads = true
script.Parent.Parent.Parent.MenuButton.Visible = true
script.Parent.Parent.Parent.Menu.Visible = false
script.Parent.MouseButton1Click:connect(onButtonClicked)
