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

How to make a player have god mode without changing the hp and visual looks?

Im currently using this way of making the player undamageable, but i dont want to change the Players hp or do anything that visually stands out, any help?

humanoid.MaxHealth = math.huge
humanoid.Health = math.huge

2 answers

humanoid.MaxHealth = "sub to creeper movie12"

7 comments

0

are you just promoting some dumb channel or something...?

0

Also this is literally what my script does

0

f u

0

LMAO

0

learn how to code and get a life

0

Lmao but if you actually knew now to code you would have solved this with actual code, also you should get a life, your the person trying so hard to promote a dumb channel

0

Stop, or I will take action.

If you want the player to be invincible (god mode) add this script into the humanoid:

while wait() do
     script.Parent.Health = script.Parent.MaxHealth
end

Make sure that script is disabled. In another script, have a way to toggle it. For demonstration perposes, I'll use a part that, when it's touched, toggles god mode

script.Parent.Touched:Connect(function(hit)
     if hit.Parent:FindFirstChild("Humanoid") then
          local hum = hit.Parent:FindFirstChild("Humanoid")
          if hum:FindFirstChild("GodModeScript") then
               local god = hum:FindFirstChild("GodModeScript")
               if god.Disabled == true then
                    god.Disbaled = false
               elseif god.Disabled == false then
                    god.Disabled = true
               end
          end
     end
end)

2 comments

0

can i make it so its in 1 script though?

0

and i want it with other lines of code to, while ttrue do kinda makes it not work...

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