Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How and Why wouldn't my Forever Death work?

I was testing on my script, I did use the Diedevent. Here is the Code I used:

local hum=game.Players.LocalPlayer.Character.Humanoid
hum.Died:connect(function()
	hum.Parent:Destroy()
end)

The character does destroy, However, The Character Does load after 5 seconds.

1 answer

✓ Accepted answer

This is because the Died event activates the LoadCharacter method of the player. So the easiest way to simulate a 'permadeath' would be setting the CharacterAutoLoads Property of the player to false when they die.

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		plr.CharacterAutoLoads = false
		local hum = char:WaitForChild('Humanoid')
		local connect
		connect = hum.Died:connect(function()
			plr.Character:Destroy()
			connect:disconnect()
		end)
	end)
end)

1 comment

0

first, there shouldn't be an Value at the end. second, the CharacterAutoLoads should be outside the function.

This discussion is preserved as it was. New answers, comments, and votes are closed.