Hi There, i was Scripting a Tool Activates whatever they Touch HumanoidRootPart.
and i give 3 Tools to the NPC’s Inventory and i started to script to Touch HumanoidRootPart that Tool Activate. and i tested out the script and when NPC’s Tool Touches HumanoidRootPart with Sword, and nothing happens. and i have no clue to fix it.
Here’s a Script:
local Tool = script.Parent:FindFirstChildOfClass("Tool")
Tool.Handle.Touched:Connect(function(hit)
if hit.Name == "HumanoidRootPart" then
local Tool_deboune = false
if Tool_deboune == false then
Tool:Activate()
Tool_deboune = true
delay(1, function()
Tool_deboune = false
end)
end
end
end)
it Has 3 Tools in NPC’s Inventory for Example:
- ClassicSword
- Dark of Sword
- Healing Potion
Please Give me a any solutions to fix it issues