I'll fix your problems!
First we use the function Touched. When the part is touched, this function will activate.
1 | script.Parent.Touched:connect( function () |
Next step is to find out what hit the part. Fill in the argument after function to hit.
1 | script.Parent.Touched:connect( function (hit) |
Now, we check if it is actually a human that is touching it. For that, we use FindFirstChild.
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
If it was a player, now we give them the health.
1 | script.Parent.Touched:connect( function (hit) |
2 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
3 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health + 100 |
Is something not working or something you don't understand? Message me on ROBLOX! (Lukeisbossman64)
=D
Closed as Not Constructive by EzraNehemiah_TF2, unmiss, GoldenPhysics, and M39a9am3R
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?