I'll fix your problems!
First we use the function Touched. When the part is touched, this function will activate.
script.Parent.Touched:connect(function()
end)
Next step is to find out what hit the part. Fill in the argument after function to hit.
script.Parent.Touched:connect(function(hit)
end)
Now, we check if it is actually a human that is touching it. For that, we use FindFirstChild.
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
end)
If it was a player, now we give them the health.
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health + 100
end)
Is something not working or something you don't understand? Message me on ROBLOX! (Lukeisbossman64)
=D
1 comment
Try these links: http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched http://wiki.roblox.com/index.php?title=API:Class/Humanoid/TakeDamage http://wiki.roblox.com/index.php?title=Making_a_Health_Pickup. The wiki sure is a great tool.