Alright I made a MedKit. Strange thing is, it works when I test it in ROBLOX Studio, but when I play the actual game, the medkit does not work. It is composed of a Tool named Medical Kit, a Union inside named Handle, and a Script named MedKitScript. It is a normal script.
local tool = script.Parent
local healValue = 50
local canHeal = true
tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
local humanoid = tool.Parent.Humanoid
if humanoid and canHeal then
canHeal = false
local currentHealth = humanoid.Health
local newHealth = currentHealth + healValue
humanoid.Health = newHealth
wait(2)
tool:Destroy()
end
end)
end)
