Hey Everyone,
So I’m making an extra health gamepass where it gives them 150 health instead of 100, but it’s not working.
Here is my script:
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function()
if MPS:UserOwnsGamePassAsync(Player.UserId, 10479398) then
Player.Character.Humanoid.MaxHealth = 150
wait()
Player.Character.Humanoid.Health = 150
end
if Player.Name == 'Little_Joesz' then
for _, v in pairs(game.ReplicatedStorage.GamepassTools:GetChildren()) do
local clonedTool = v:Clone()
clonedTool.Parent = Player.Backpack
if clonedTool:FindFirstChild('Script') then
clonedTool:WaitForChild("Script").Disabled = false
end
end
end
for i, gamepass in pairs(game.ReplicatedStorage.GamepassTools:GetChildren()) do
if MPS:UserOwnsGamePassAsync(Player.UserId, gamepass.Name) then
local clonedTool = gamepass:Clone()
clonedTool.Parent = Player.Backpack
if clonedTool:FindFirstChild('Script') then
clonedTool:WaitForChild("Script").Disabled = false
end
end
end
end)
end)
Look at the part where it says Humanoid.MaxHealth.
This is a serverscript. I get no errors, but the player still has 100 health! Thanks for any help!