I’m basically making a tool that would heal a player to 90 health. Obviously, it wouldn’t bring someone’s health down if it was above 90 health. Everything in the script works, but the part that is supposed to heal the player. Here’s the script:
local Animation = Tool.Animation
Tool.Activated:Connect(function()
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
if Humanoid.Health < 90 then
Humanoid.Health = 90
end
wait(1)
Tool:Destroy()
end)
If it is in a localscript then the player’s health will only be changed locally. They won’t actually be healing on anyone else’s screen or to the server.
Create a remote event inside the tool, only play the animation locally, and then use a normal script which fires whenever that remote event is fired, then just do whatever you need to heal.