Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by 4 years ago
humanoid.MaxHealth = "sub to creeper movie12"
0
are you just promoting some dumb channel or something...? BrandonXYZ9 18 — 4y
0
Also this is literally what my script does BrandonXYZ9 18 — 4y
0
f u jaydencreeperpro -13 — 4y
0
LMAO BrandonXYZ9 18 — 4y
View all comments (3 more)
0
learn how to code and get a life jaydencreeperpro -13 — 4y
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 BrandonXYZ9 18 — 4y
0
Stop, or I will take action. LinavolicaDev 570 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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)
0
can i make it so its in 1 script though? BrandonXYZ9 18 — 4y
0
and i want it with other lines of code to, while ttrue do kinda makes it not work... BrandonXYZ9 18 — 4y

Answer this question