Hello MTA...
Sorry for asking rookie questions so frequently.
So, I am trying to make NPC's on the map walk around.
I know I will have to give them a path to walk (Which I don't know how to do, but I'll get there).
Right now I am finding it hard to get my NPC to even move.
This is the very basic coding I have so far.
Pedestrians.lua
function pedLoad()
local thePed = createPed ( 106, 2492, -1673, 13.25, 200)
setPedAnimation(thePed, "ped", "walk_gang1", -1, true, true, false, true)
outputChatBox("This command did something", player, 100, 255, 100)
end
addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad )
Now this works properly:
local thePed = createPed ( 106, 2492, -1673, 13.25, 200)
It creates my NPC and rotates him 200 degrees...
But the rest of the coding doesn't do anything.
I have tried setControlState:
function pedLoad()
local thePed = createPed ( 106, 2492, -1673, 13.25, 200)
setControlState(thePed, "walk", true)
setControlState(thePed, "forwards", true)
outputChatBox("This command did something", player, 100, 255, 100)
end
addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad )
And nothing happened...
I know with setControlState I also have to change his camera to move in different directions but I can't get him to move at all...
So, if someone could help me I would appreciate it.
Thank You.