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

This script I have is adding and then removing health, why is it removing the health?

Asked by 3 years ago
Edited 3 years ago

local tool = script.Parent local CanActivate = true tool.Activated:connect(function() local humanoid = tool.Parent:FindFirstChild("Humanoid") local animation = script.Drink local AnimationTrack = humanoid:LoadAnimation(animation) if CanActivate == true then CanActivate = false AnimationTrack:Play() wait(1) humanoid.Health = humanoid.Health + 50 wait(10) CanActivate = true end end)
0
Is the script a localscript and is the tool restoring the health? For example, if I take 50 damage and apply the tool, the health goes back to 50 after 1 second? Rukreep 15 — 3y
0
i don’t know why it remove the health, but it seems like the remove health problem is from another script no this( maybe, i never try to add health to player when the player health is at max) daokhiethy 25 — 3y
0
if this is a local script, the health change will only be client sided. when a server script looks at your health, it wont see the change and any changes it does will be relative to the original health which will then be replicated back to the client (effectively removing the change) potatomay 20 — 3y

Answer this question