@britton_21
Roblox Nov 05, 2026

Making an admin god mode command for my own game

I want myself and my mods to be immune to damage while testing levels. Is it better to set MaxHealth to huge or to block damage another way? Script runs on the server.
1

Leave A Reply

Log in to post an answer.

1 Answer

singh_55 Nov 12, 2026
britton_21
Do it from a server Script, not a LocalScript, since health has to change on the server. Rough version: local admins = {[12345678] = true} -- your UserId game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if admins[plr.UserId] and msg == "!god" then local hum = plr.Character and plr.Character:FindFirstChildOfClass("Humanoid") if hum then hum.MaxHealth = math.huge hum.Health = math.huge end end end) end) Check by UserId, not username, names can change. If your game uses TextChatService you can do the same thing with a TextChatCommand. A ForceField in the character works too if you want the visual.