Idle NPC
#1

Well I recently came back into scripting and all this NPC stuff is new to me. I'm working on a gamemode and I just can't figure out how to make a NPC which is just standing there, doing nothing. All this stuff with the recording just confuses me, can I make an NPC inside my main script and set his skin and what so ever, without having to record stuff or creating a script for him? Will the NPC take a server slot? If so, is it possible to set his ID high enough to the top of the players list?
Toturials weren't really helping me, is it possible to just create it, set its spot and simply leave it there?

Thank you.
Reply
#2

NPC do take player slots

NPC's are hidden from the Player list

Yes you can read this

Make a NPC script only with the folowing

pawn Код:
#include <a_npc>
main(){}
Load the NPC set hes possition angle interior and stuff. And freeze him.


This or just record it with no movement for 20 seconds or somthing
Reply
#3

And how do I load it? Do I not need to pass him the login process or something like this?
Oh and, will they cause other players' IDs to skip the ones used by the npcs?
Reply
#4

It wont skip player id's no what it will do is it will give the NPC's the very last id's for example id 500 also you have to goto the login and before you run the dialog or command you have to check if a player is a NPC and send him through a differnt process yes so normal Player login would be under a else statement
Reply
#5

Alright, great, so I will just process him through OnPlayerConnect, and what about onplayerspawn and others? Does he passes through them as well?

Thank you btw
Reply
#6

Its ok and yes you use onplayer spawn to set his skin and such his co-ords

and thats fine i dont mind helping
Reply
#7

Also don't freak out but if you have your server set to say 500 players, and you have 45 npcs running, it will only show that you have a max players of 455. This is because the npcs are using the other 45 slots so you cannot fake having a hundred players or something like that.
Reply
#8

Uh, thank you but for some reason the IDs do not start from zero, and the NPCs take the first available slots...
Reply
#9

I don't think its possible really to set an NPC's ID to the last in the list..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)