So i want to script mouse ai, that means if the players mouse is on a npc it will chase them but it doesnt work._.
while true do
wait()
for i, Player in pairs(game.Players:GetPlayers()) do
local Mouse = Player:GetMouse()
local Position = Mouse.Hit.p
end
end
09:16:47.764 Workspace.Dummy.AI:5: attempt to index nil with ‘Hit’ - Server - AI:5