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 script where I pull out a Tool and it Increases my health?

Alright, so I wan't to pull out a Tool called Lightsaber, And upon pulling it out, It increases my health to 500.

2 answers

Not sure what you mean, but do you mean this? Put this script inside the tool.

local Tool =script.Parent
local Char = Tool.Parent.Parent.Character
local value = 500
Tool.Equipped:connect(function(mouse)
Hum = Char:WaitForChild("Humanoid")
if Hum ~= nil and Hum.Health ~=0 then
		Hum.Health = Hum.Health + value
	end
end

Put this LocalScript into the Tool.

local plr = game.Players.LocalPlayer
local tool = script.Parent

tool.Equipped:connect(function()
	plr.Character.Humanoid.Health = plr.Character.Humanoid.Health + 500
end)

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