I'm not sure what I did wrong. I get an error when doing these functions to my tool.
local tool = script.Parent.Parent tool.Equipped:Connect(function(equip) local humanoid = equip:FindFirstChild("Humanoid") if (humanoid ~= nil) then humanoid.Health = 50 end end) tool.Unequipped:Connect(function(equip) local humanoid = equip:FindFirstChild("Humanoid") if (humanoid ~= nil) then humanoid.Health = 100 end end)
Equipped and Unequipped pass the LocalPlayers mouse as the Parameter. You can just access all that you need before the event scopes.
local tool = script.Parent.Parent local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() local humanoid = character:WaitForChild("Humanoid") tool.Equipped:Connect(function() humanoid.Health = 50 end) tool.Unequipped:Connect(function() humanoid.Health = 100 end)
I don't think equip is a property in the parenthesis.