[FCNPC] NPC move randomly
#1

Hello!

I'm trying to make my NPC made with FCNPC move randomly, but it seems my knowledge doesn't allow me to do so, lol.

Here's my ''Move NPC'' function

Quote:

public MoverBandido(npcid)
{
new Floatb, Float:yb, Float:zb;
GetPlayerPos(npcid, xb, yb, zb);
new m = 0;
if(m == 0)
{
m++;
switch (m)
{
case 10:
{
FCNPC_GoTo(npcid, xb+10, yb, zb, FCNPC_MOVE_TYPE_WALK);
}
case 20:
{
FCNPC_GoTo(npcid, xb+20, yb, zb, FCNPC_MOVE_TYPE_WALK);
}
case 50:
{
FCNPC_GoTo(npcid, xb+20, yb, zb, FCNPC_MOVE_TYPE_WALK);
}
case 70:
{
FCNPC_GoTo(npcid, xb+5, yb, zb, FCNPC_MOVE_TYPE_WALK);
m = 0;
}
}
}
}

I know it will not make them move ''randomly'', but they're not moving at all, they just spawn and stand still. What can I do?
Reply
#2

they'll stay if u dont loop or do something.
Reply
#3

Quote:
Originally Posted by Mugala
Посмотреть сообщение
they'll stay if u dont loop or do something.
Excuse my noobness, but isn't using switch enough?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)