How can I delete the player character?

Doing so will make the game unplayable.
If the game interacts with the character, you can expierience unexpected deaths, because that train just pushed your character off the map.

1 Like

I didn’t get it, what do you mean?

1 Like

That means that it can’t access Client sided stuff like the LocalPlayer. So basically it’s not like a LocalScript

1 Like

Did it and the script you showed me? Did it too. Spammed the output with Humanoid Missing, and still showed the Half of the player.

1 Like

Can’t you just do game.Players.PlayerAdded method?

--script in serverscriptservice
game.Players.PlayerAdded:Connect(function(player)
if player.Character then player.Character:Destroy() end
player.CharacterAdded:Connect(function(char)
char:Destroy() 
end)
end)
1 Like

It would be the same way. Just doing:

function onCharacterAdded(character)
   character.Archivable = true
   character:Destroy()
   -- Or you can also do:
   character.Parent = game.ServerStorage
   -- Or only do:
   character:ClearAllChildren()
end

function onPlayerAdded(player)
   player.CharacterAdded:Connect(onCharacterAdded)
end

Players.PlayerAdded:Connect(onPlayerAdded)

Some ways

1 Like

It does the same thing, but the player is gone.

1 Like

Okay yeahs there’s got to be something wrong internally because all of these methods should’ve worked to a degree

1 Like

Well yeah, but for my method, it got a problem with the Roblox Security.

1 Like

The only way I could think of is setting player.Character to a random Model then destroy that character (nvm it wouldn’t error but the player is gone)

local char = player.Character
player.Character = game.Workspace.Model -- random model
char:Destroy()
1 Like

--script in serverscriptservice
game.Players.PlayerAdded:Connect(function(player)
	local char = player.Character
	local model = Instance.new("Model")
	model.Parent = workspace
	player.Character = model
	char:Destroy()
end)
1 Like

change it to player.Character or player.CharacterAdded:Wait()
Also you might need to set camera position to the previous position of the character on the client, if you don’t want to see just a sky

1 Like

Which one should I change???

1 Like

Change that to local char = player.Character or player.CharacterAdded:Wait()

1 Like

I normally do

-- Assuming player is defined here
local char = player.Character or player.CharacterAdded:Wait()
player.Character = nil
char:Destroy()
1 Like

Workspace is cleared.
I see only the sky blue.

1 Like

the camera might get put at a random position where you cant see anything because of deleting the character, you sure theres actually nothing in the workspace? check server view if theres anything in the workspace (baseplate or something else)

1 Like

You can’t delete the character forever, and without character the Gui isn’t working.
The best thing you can do is to set a custom character, with a small invisible anchored part as a HumanoidRootPart, and set the camera type to scriptable / camera subject empty, then do whatever you want.

3 Likes

parent the character into replicated storage one heartbeat after character loaded event

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.