How to make a system, where the players can customize the NPCs that are working for the player

Hi there, currently trying to gather information and scripts that i needed to build an office tycoon game, where you can build your office and gain a lot of money. I got the furniture placement script, now the only thing i want however, is the ability for players to customize their office workers. But so far i can’t find a tutorial for it.

  1. Is there a tutorial for it?
  2. What’s the best GUI design, for a customization for NPCs?

I really appreciate your help

1 Like

Unfortunately there’s no one and done way to do this, I would pull inspiration from other games that have any kind of character customization in terms of finding the best GUI, figure out what you like, don’t like, and what you think people will need/want to customize.

In terms of the coding aspect, there are so many ways you can go about creating something like this, I would personally use modules that return tables to act as item databases. The hierarchy might look something like this:

image

The pants data table might look something like this:

--Pants
return {
	["Spiffy Pants"] = {
		Id = "rbxassetid://94839758", -- Ranodm id I used, idk if this is valid.
		--Other info you might need, for example; Listed, Price
	}
}

Somewhere in your Gui script you’ll want to loop through all the accessory tables, and create the respective ui elements based on the category name, and item name while assigning a button to change the appearance of the worker, a quick example of this would be;

  1. Click “Spiffy Pants” UI Element
  2. Get worker pants
  3. Change worker pants ID
2 Likes

Thanks for the help, really appreciate it

So just make the hierarchy and then put it inside the GUI script?

That’s one way of doing it yeah, I usually keep my data tables inside replicated storage for shared access though

I mean, Restaurant Tycoon 2 kinda done this, with you being able to customize the NPCs that work for you, trying to replicate it with an asset ID