Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a healing pad?

I have a healing pad. I used a script.

game.Workspace.HealingPad.Health = 100

Is it the right one or not?

3 answers

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):

script.Parent.Touched:connect(function(hit)
	if hit.Parent:findFirstChild("Humanoid") then -- Make sure it's a human
		hit.Parent.Humanoid.Health = hit.Parent.Humanoid.MaxHealth --No matter the health, refill it
	end
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.

script.Parent.Touched:connect(function (hit)
	if not hit.Parent:findFirstChild("Humanoid") then return end --Cancels function if it's not a player that touches it.
	hit.Parent.Humanoid.Health = 100 --Sets the health of the touching player to 100.
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.

1 comment

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.