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

so my antigod script is not working please help?

Asked by 8 years ago

heres the script

if game.Players.LocalPlayer.Character.Humanoid.MaxHealth = math.huge 
then
game.Players.LocalPlayer.Character.Humanoid.MaxHealth = 0
else game.Players.LocalPlayer.Character.Humanoid.MaxHealth = 100
end

if game.Players.LocalPlayer.Character.Humanoid.Health = math.huge
then game.Players.LocalPlayer.Character.Humanoid.Health = 0
else game.Players.LocalPlayer.Character.Humanoid.Health = 100

2 answers

Log in to vote
1
Answered by 8 years ago

You seem to be missing an end at the end. Also, you might want to do a check every few seconds like this:

while true do
wait (1)
if game.Players.LocalPlayer.Character.Humanoid.MaxHealth = math.huge 
then
game.Players.LocalPlayer.Character.Humanoid.MaxHealth = 0
else game.Players.LocalPlayer.Character.Humanoid.MaxHealth = 100
end

if game.Players.LocalPlayer.Character.Humanoid.Health = math.huge
then game.Players.LocalPlayer.Character.Humanoid.Health = 0
else game.Players.LocalPlayer.Character.Humanoid.Health = 100
end
end
Ad
Log in to vote
1
Answered by
yoshi8080 445 Moderation Voter
8 years ago

I used variables to shorten it also, I would recommend using WaitForChild to get Humanoid and CharacterAdded:wait() to get character.

EDIT: Added a loop

plr = game.Players.LocalPlayer
char = plr.CharacterAdded:wait()
human = char:WaitForChild('Humanoid') -- Waits for Humanoid so it's detected
while wait(5) do  -- every 5 seconds, it checks for the health.
if human.MaxHealth == math.huge then -- It's best to use MaxHealth since the health can't be more than MaxHealth.
human.MaxHealth = 0 -- sets max health to zero if maxhealth = math.huge
human.Health = 0 -- sets health to zero if health = math.huge
else
human.MaxHealth = 100
human.Health = 100
end
0
still not working wiktorwiktor12 0 — 8y
0
Any errors? yoshi8080 445 — 8y
0
Well it should work I have tried it with MaxHealth and it set the player's health to 0 yoshi8080 445 — 8y
0
what did you use to give yourself the god wiktorwiktor12 0 — 8y
View all comments (5 more)
0
A normal health pad to increase max health to math.huge yoshi8080 445 — 8y
0
link to the model please wiktorwiktor12 0 — 8y
0
just look one up in fm, change the script inside to human.Health = math.huge yoshi8080 445 — 8y
0
do you also change thr maxhealth wiktorwiktor12 0 — 8y
0
I only changed the max health and after the check is done, it'll kill be player if their max health is math.huge yoshi8080 445 — 8y

Answer this question