I have this script that adds Health when they join my game is they have a certain Game pass. It works perfectly. There is one problem though when they get the health it doesn't put it at that health. As in it puts the max health there but they haven't healed yet so it is still 100 health. I was wondering how I could edit the script to put there health to 250 when it is done changing the max health. (Healing them to the max health) Script:
local gps = game:GetService("GamePassService"); local id = script:WaitForChild("GamePassID"); local Health = script:WaitForChild("ExtraHealthAmount"); game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(char) --CharacterAdded event char:WaitForChild("Humanoid") --Just to be safe(; if gps:PlayerHasPass(Player , id.Value) then local hum = Player.Character.Humanoid hum.MaxHealth = hum.MaxHealth + Health.Value end end) end)
If you could help it would be really nice. THANKS!
if am not wrong ur looking to make ur Health the same as ur MaxHealth (or no? interrupt me if am wrong)
just add
hum.Health = hum.MaxHealth
Marked as Duplicate by Goulstem, EzraNehemiah_TF2, Redbullusa, and adark
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?