gps = game:GetService("GamePassService") id = script:WaitForChild("GamePassID") -- number value EH = script:WaitForChild("ExtraHealthAmount") -- number value local function onVIPSpawned(player, character) local human = character:WaitForChild("Humanoid") human.MaxHealth + EH.Value -- it says it expects a '=' sign, but got a '+' human.Health = human.MaxHealth end local function onPlayerAdded(player) if gps:PlayerHasPass(player, id.Value) then if player.Character then onVIPSpawned(player, player.Character) end player.CharacterAdded:connect(function () onVIPSpawned(player, player.Character) end) end end for k, player in pairs(game.Players:GetPlayers()) do onPlayerAdded(player) end game.Players.PlayerAdded:connect(onPlayerAdded)
On line 7 if i have human.MaxHealth = EH.Value, it works and changes the health to 50, but i need it to add 50, and human.MaxHealth + EH.Value doesn't work though. The 50 is the value i have for ExtraHealthAmount. So how do i make it stack up?
Change Line 07
to:
local newHealth = humand.MaxHealth + EH.Value
Then change Line 08
to:
human.MaxHealth = newHealth human.Health = human.MaxHealth
The reason your code does not work is because you are not setting the 'MaxHealth' value, you are simply making a value that gets deleted straight after it's made.
Hope I helped :)
~TDP