So I have a script listening to a RemoteEvent to see when to give x client infinite health. Problem is, when it does get called it doesn't work at all. I don't understand why it doesn't because setting the players health to something like 300 works. The game does have FilteringEnabled, and no output is printed.
function GetHumanoidFromPlayer(Plr)
if (Plr ~= nil) then
if (Plr.Character ~= nil) then
local Find = Plr.Character:FindFirstChild("Humanoid")
if (Find) then
return Find
end
end
end
return nil
end
InfHealth.OnServerEvent:connect(function(Plr)
if (CheckAdmin(Plr)) then
local Hum = GetHumanoidFromPlayer(Plr)
if (Hum ~= nil) then
Hum.MaxHealth = math.huge
end
end
end)

5 comments
are you sure that it's actually not changing the health? When dealing with math.huge, the health regeneration script will regenerate all of the health in a single frame (due to it being effectively infinite). I'm not sure if you're going off of the fact that the health bar doesn't get damaged when you set the health to decide if it's working or not. Other than that, it's kind of hard to gather w
...what the problem is from what you posted.
I have a gui telling me what my current health is, when I change it to math.huge it doesn't do anything. Video: https://www.youtube.com/watch?v=v7bLWRJwhfA
And you're sure that your InfHealth event is actually running? You can't just type "math.huge" into the box, because "math.huge" can't be converted to a number directly. It will give you nil instead, which will then be converted to "0" when you try to set a number property
Holy crap i'm dumb it was a spelling mistake... -.- http://i.imgur.com/8UjWmnM.png My bad!