If you look in the event section, there are around 3 events you are interested in: Equipped, Unequipped, and Activated.
Next, you will need to toggle a bool variable when you click. You can do this very simply by doing:
-- somewhere near the top
IsHealing = false
-- later
Tool.Activated:Connect(function()
IsHealing = not IsHealing -- this will flip it to true and false every click
if isHealing then
-- PLAY ANIMATION HERE
else
-- STOP PLAYING ANIMATION
end
end)
Note that above code is simply pseudo code and you will have to make it work.
To play an animation, you need to create an animation in Roblox Stuido and upload it. Once you do so, create an Animation object and call LoadAnimation on an Animator object (these will be inside of your Humanoid.)
Here’s some useful links:
The last thing is the actual healing.
You can create a while loop at the very bottom of the script. When IsHealing is true, simply Heal x amount to the player.
Good luck.
Edit: I forgot that to heal, you will need the Server to do so. You need a Script on a server and will need to use RemoteEvent to talk to it.
Ninja_Deer gave you all you needed without giving you the entire code but if you are stuck with the loop here is some code that may help.
In the loop you can do
Humanoid.Health += Humanoid.MaxHealth x 0.01
You can change the values and the speed of the loop to slowly heal the player involving that line of code. I would also add a check to make sure they don’t go over max by doing
if Humanoid.Health > Humanoid.MaxHealth then
Humanoid.Health = Humanoid.MaxHealth
end
That’s right. There’s also a deactivated event. I would look on the documentation a lot and read each description before you use it. It explains both of these methods.