RQ:NPCs | NPC customers for your café needs!

Giver RegisterQueueNPC

:warning: RegisterQueue V1, the open-sourced register and barista queue system, is required to use this product.


The RegisterQueue: NPC Extension serves as a way to seamlessly add NPCs into your café game. Adding NPCs into cafe games gives baristas a constant supply of customers ensuring that they are kept active and engaged during playtime.

RegisterQueue’s adaptation of this must-have feature reduces clutter in your build by using existing registers as points for NPCs to meet baristas. This means that separate NPC-only queues are completely unnecessary, and your game will not have NPCs waiting to be claimed by others - they are automatically assigned to the barista and go straight to their register.

What can this do?

  • spawns NPC customers and walks to a register, creates orders and asks the assigned barista for them
  • checks items based on the item’s names and tooltips, and validates the order or asks for the item again
  • walks away from the registers to a de-spawning point and vanishes
  • the ability to add an NPC gamepass where players can purchase a gamepass for NPC characters to appear with their avatar
  • add default usernames, which NPCs will take avatars from
  • UPCOMING: use Giver, Register, and RQ:NPC together for a fully-functional café system with extended points functionality!

With extra scripting, the system natively supports:

  • a setting in which baristas can turn off NPCs, just for them
  • awarding points for baristas for completing orders through a BindableEvent ‘API’

To install RegisterQueue…

Expand on each step for a video demonstration and details! Note that the place must be published, with the required security features turned on for play testing in Studio. Click here for the model.

These instructions assume that the latest version of RegisterQueue V1, a required product, is already installed correctly. Please refer back to the installation instructions of that product found at RegisterQueue | register system, activity tracking and queue system with Basic Admin Essentials features for your café needs! before coming here.

Create a Part called 'NPCSpawn' for each register in front of it.

The video duplicates the existing TeleportPart.

Obtain the model from the Creator Store and execute the enclosed code from the Command Bar.
local RQ = game.InsertService:LoadAsset(99266195826216) 
RQ.NPCUnwrapper.RegisterSystem.NPC.Parent = game.Workspace.RegisterSystem 
RQ.NPCUnwrapper.ServerStorage.NPCs.Parent = game.ServerStorage 
RQ.NPCUnwrapper.ServerStorage.NPCPath.Parent = game.ServerStorage 
RQ.NPCUnwrapper.ReplicatedStorage.itemsList.Parent = game.ReplicatedStorage
RQ.NPCUnwrapper.Workspace.NPCScript.Parent = game.Workspace 
RQ:Destroy()

The video assumes that the model has already been obtained. The link is here:
https://create.roblox.com/store/asset/99266195826216/RegisterQueue-NPC-Extension

Change the location of the 'Dummy' in ServerStorage > NPCs to where you want your NPCs to spawn.

NPCs will spawn at this local, and will respawn roughly at this location.
In the video, I am positioning a Part to my desired location, then copying its Position to the Dummy.

Open the ModuleScript 'itemList' from ReplicatedStorage. Add the items you would like the NPC to ask for SPECIFICALLY using the details enclosed.

You must manually enter the name of every time that you want the NPC to ask for.

The NPC system checks the item’s ToolTip as well as the name of the tool combined. So both the ToolTip and the Name must be entered into the nested array. If there is no ToolTip for that item, leave the ToolTip section for the item blank - see Milk for an example.

For example, if your item Hazelnut Latte comes in three sizes Small, Medium and Large and you use ToolTips to differentiate, you must enter this item three times with the ToolTip changing every time. For example:

local items = {
	{"Small", "Hazelnut Latte"},
	{"Medium", "Hazelnut Latte"},
	{"Large", "Hazelnut Latte"},
	{"", "Milk"} -- no ToolTip
}

Miscellaneous:

Update the NPCScript package to the latest version.

The latest version of the model does not necessarily mean that the model will contain the latest version of the system. Most of the time, this is unnecessary but pay attention to the symbol.

BONUS: adding other characters to take avatars from,

In ServerStorage > NPCs > PlayerIDs, add an IntValue. Name it to the character of the player, and add a valid user ID as the Value.

BONUS: adding an NPC gamepass,

Open the ModuleScript 'itemList' from ReplicatedStorage. Change the npcGamepass variable to your chosen gamepass ID. To turn this feature off, change it to 'nil'.

BONUS: button for players to disable NPCs for themselves,

Create a button that toggles the npcDisabled attribute on the server that players will have, this is off by default. This attribute being TRUE will turn NPCs off for themself.

The uncopylocked test place will have an example of this, with the button used being made through TopbarPlus V3.


Development link

RegisterQueue V1 is required to use this product because this extension seamlessly uses existing register architecture, meaning losing space to distracting ‘NPC queues’ is no longer needed!

Every time a successful NPC order is completed, the server-based BindableEvent game > ReplicatedStorage > NPCExtension > successfulNPC will be fired with two variables - the first being the username of the barista, and the second being an integer of how many items was ordered.

Players will have the following attributes:

  • npcDisabled - turns off NPCs for them if true.

Register models will have the following attributes:

  • hasNPC - true if an NPC is present at the register

NPC dummies (all NPCs in the system are named ‘Dummy’) will have the following attributes:

  • assigned - the username of the barista that they are assigned to
  • assignedTo - the name of the register that the barista has claimed, thus the name of the register that they walk to

About the project…

The RegisterQueue: NPC Extension was originally meant to be shipped with RegisterQueue V1, however a later release has allowed for a much more versatile product. There is large demand for an NPC system (1), and the open-sourced nature of this product makes it even better. The model comes with SimplePath as a tool for pathfinding. If you have any questions, suggestions or anything that needs to be fixed, please notify me!

RegisterQueue: NPC Extension (or rq:npc) is completely free and open-sourced. This project has been released under the MIT license. Additional information on the license can be found in this page.


Is this for you?

Feel free to use the uncopylocked test place to see if the system meets your needs! Use the :tools and the :give me TOOLNAME command (by using the names from the :tools list) to hand yourself the items to give to the NPC.

Thank you,
Iralyst :heart:
~discord: @iralyst

7 Likes

Awesome resource! Thank you so much for releasing it to everyone!

1 Like

Yeah it was fun pushing him into the void after he kept saying I was giving him the wrong thing

Hi! To give yourself the items in the testing place (to then give them to the NPC) you can use the admin system in the game to use the :tools command in chat, then the :give me TOOLNAME command in chat using the corresponding name in the :tools panel.

cool.,.,.,.,.,.,.,.,.,.,.,.,.,.,…,

Very nice resource thank you so much for releasing this!

1 Like