How to prevent player from dying if character model deleted

Hello I’m making a game where only the GUI exists and I don’t want players from dying. I already disabled resetting but hackers can force kill themselves by putting their health to 0 or deleting the character (Which effectively ruins my game) as the entire point of the game is to not die and hackers can use this to cheat.

Is it possible to completely erase the death system? the player has no need to die in my game. Quite frankly, if possible It’d be nice to delete their avatar as well.

1 Like

Set CharacterAutoLoads to false.

game.Players.CharacterAutoLoads = false

Players.CharacterAutoLoads

1 Like

okay, should i do it on the server or the client? also if on the server, should i put it in a playeradded event?

It’s a property of PlayersService, not the actual player itself.

You can do it in studio.

Hey i just tried your solution and i noticed it deletes my screengui. Now, unfortunatly this is worse than hackers force killing themselves as like i said before my game is gui mainly

Is it ‘deleting it’ or is it just not being parented? You could manually write code to give the GUI to the client.

game.Players.PlayerAdded:Connect(function(player)
     local gui = game.StarterGui.Gui:Clone()
     gui.Parent = player:WaitForChild("PlayerGui")
end)
1 Like

i didnt see the code you wrote so i wrote my own:

local screen = game.ReplicatedStorage.ScreenGui
game.Players.PlayerAdded:Connect(function(plr)
local clone = screen:Clone()
repeat wait(0.1) until plr:FindFirstChild("PlayerGui")
clone.Parent = plr.PlayerGui
end)

Overall the solution worked, so thanks.

by the way i just finished my game since this issue was the last thing i had to work on. There might be some bugs since i just made it but I’m pretty hype about just finishing it!

this is the game: Reaction trainer for FPS - Roblox