Hey i have this code:
[lua]
function find_me(ply)
local schdRunner = ai_schedule.New( "AI Random Run" )
schdRunner:EngTask("TASK_GET_PATH_TO_ENEMY", 128) --RANDOM_NODE", 128)
schdRunner:EngTask("TASK_RUN_PATH", 0)
for k,v in pairs(ents.FindByClass("npc_combine_s")) do
Msg(k .. "- ")
v:StartSchedule(schdRunner) --line 11
Msg("Schedule Run!")
end
end
concommand.Add(“findme”, find_me)
[/lua]
But when i run the findme command i’m getting this error:
1- autorun/server/dropme.lua:11: attempt to call method 'StartSchedule' (a nil value)
Which makes me think that if StartSchedule is a nil value that you cannot use it on normal npc’s. Is this correct? or what am i doing wrong?