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

I made a game pass script for extra health, and it doesn't seem to work, why not?

Asked by 8 years ago
gps = game:GetService("GamePassService");

id = script:WaitForChild("GamePassID");
EH = script:WaitForChild("ExtraHealthAmount");


game.Workspace.ChildAdded:connect(function(char)
h=char:FindFirstChild("Humanoid")
if h~=nil then
    plr=game.Players:FindFirstChild(char.Name)
    if gps:PlayerHasPass(plr, id.Value) then
        h.MaxHealth=EH.Value
        h.Health=EH.Value
    end
end
end)

This is the script which i put into ServerScriptServices, and its a regular script, not local. I added 2 number values as well into the script as well, one which is GamePassID and the id is in the value, and ExtraHealthAmount which i set the value of to 50. Yet when i go to test it out, my health remains 100. And it should work for me because i already have it of course.

Answer this question