I have a healing pad. I used a script.
1 | game.Workspace.HealingPad.Health = 100 |
Is it the right one or not?
You need it to function when a human touches it using the Touched event and then you need to change the players health (put this script inside the part):
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit.Parent:findFirstChild( "Humanoid" ) then -- Make sure it's a human |
3 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.MaxHealth --No matter the health, refill it |
4 | end |
5 | end ) |
Nope. You may want to try the following. Read the notes to help you. You're actually setting the part's health to 100, and the part does not have a property called health.
1 | script.Parent.Touched:connect( function (hit) |
2 | if not hit.Parent:findFirstChild( "Humanoid" ) then return end --Cancels function if it's not a player that touches it. |
3 | hit.Parent.Humanoid.Health = 100 --Sets the health of the touching player to 100. |
4 | end ) |
I'm Aurum, and you're welcome.
FIrst you need to learn the Touched event. SO when the Character touches the pad he/she gets more health. I suggest learning the touched event.