It's a Script located in a NPC. It's a part,not all the script. The point of this script,is verifying if the target is a player,but,it doesn't work.
wait(math.random(1,5))
player = game:GetService("Players")
local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
if not target == player then
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end

2 comments
Give a proper explanation.
You want to make sure that it's not a player, so the easiest way, is to check if there's a player for that character model(using game.Players:GetPlayerFromCharacter(), using "not" means that, if there's not a player for it, then do your stuff