NPC Bank

I was in this rp server before and there was an npc that you could store your guns and stuff so when u come back to the server its saved. You just go to him and get them back. So could you make something like an npc that stores stuff for you? And is there something that you could make so it would spawn in the map every time server would to restart?

Are you sure it was a npc or sent? A npc is almost imposable if not is imposable. We need more info before anyone could answer

A SNPC is exactly the same as a SENT. It’s basically just a scripted entity has more abilities. All of this is easilly doable. The required components are :

  • Spawning an entity at map start.
    Accomplished by a **[Gamemode.InitPostEntity](** hook in an autorun script.

  • Having that entity be an NPC.
    Make a basic NPC with no scripted behavior that will just stand there until used, very simple.
  • Have a menu pop up when the NPC is used.
    Create a menu with derma and link it to the NPC’s Use hook.
  • Save and retrieve the player’s data.
    Use **[Player.GetPData](** and **[Player.SetPData](** or a custom SQL query (More optimal). This also involves sending data to the server from the VGUI so you know when to load and save the player’s data.

Would this be possable then as something I can just spawn on sandbox and not save all of the stufe. Or if possable like a adv so you can take it to other servers that have it or your own other servers.