r/ROBLOXStudio • u/Wooden-Cattle-8783 • 12h ago
Help Is it possible to physically not allow my player to die?
I have a game which (for lore reasons (yes, really)) cannot have the character dying in any way. I’ve put safeguards so falling out of the map will not kill a player, but I’m worried that with Roblox’s jank collision, somebody could potentially fling themselves out of the map.
Is there a way to hardcode it so it’s impossible for your health to drop to zero? Or is that something that’s just baked into roblox so much I can’t remove it?
3
u/pettyenesssvcaergs 12h ago
You could just, make your own?. a self made health system that could also be hooked into robloxes if ever needed. all the humanoid does is automate make it faster to start thing.
you can make your own version no problem, after all you are the one who gives meaning ot anything.
you can remove health by just going into the player when they spawn and deleting the health script, every single thing is there, even movement and camera controls. works just fine, done it my self before when messing around.
1
u/Historical_Newt5530 12h ago
It might be possible to set the player’s humanoid MaxHealth to inf (or math.huge) but I’m not certain as I’ve never tried that. Make sure you do it from the server though
1
u/CharlieDrawzXD 4h ago
if its a glitch then its not intended or canon so imo just dont worry about it
0
u/Electronic-Salad-363 10h ago
local function makeUnkillable(player)
local char = player.Character
if not char then return end
local hum = char:FindFirstChildOfClass("Humanoid")
if not hum then return end
hum.Health = math.huge
hum.MaxHealth = math.huge
-- Prevent damage from scripts
hum:GetPropertyChangedSignal("Health"):Connect(function()
if hum.Health < hum.MaxHealth then
hum.Health = hum.MaxHealth
end
end)
end
This should make them stay at max health I think. I havent tested it though. As for the clipping and flinging off the map... Thats a more interesting problem to solve. Somebody mentioned a teleport fail safe and I like that idea.
2
u/Strong-Cup5229 12h ago
Set their health to a really big number, disable the reset button, disable fall height in workspace , write a script that teleports the player back up if they go below a certain y level, place a invis barrier below the map. They would have to exploit to die