How would i make a npc run to tool if shot?, and in 250 studs distance

So i have a flare in my game, i want if the player shots it, and the monster is in the 250 studs distance the monster would run to the flare.

In the monster

local PathingModule = require(script.Parent.Parent.PathfindingService)
local MainPath = PathingModule.new(script.Parent.Parent)
local character = script.Parent.Parent
local MaxDistance = script.Parent.Parent.Distance.Value
script.FlareEvent.Event:Connect(function(Tool)
	
	local DisMagnitude = (Tool.Handle.Position - character.Position).magnitude
	if DisMagnitude < MaxDistance then
		print("Rake was in the distance off the flare")
	
	
	local RandomTing = math.random(1,2)
	if RandomTing == 1 then
			character.Head.Rake_Scream:Play()
	elseif RandomTing == 2 then
		character.Head.Rake_Scream2:Play()
	end
	character.Inactive.Value = true
	MainPath:Run(Tool.Handle.Position)
	MainPath.Completed:Wait()
		character.Inactive.Value = false
	end
end)

In the client

	local Tool = script.Parent
					workspace.Rake.RakeMainAI.MoveAwayFromFlare.FlareEvent:Fire(Tool)

Set the Humanoid.WalkToPoint to the position of the player’s head or something? It looks like your script would work.

Problem is it errors Workspace.Rake.RakeMainAI.MoveAwayFromFlare:7: attempt to index nil with ‘Handle’ - Server -

That means the server was unable to find a part named “Handle” in the tool. Make sure that part exists and has the proper name in your tool.