Hi - I’m attempting to create a unique identifier system for each new NPC that a player creates. I’m trying to figure out how to make it so that when a player creates an NPC, the value of the ID counts upward by one for every new NPC created.
I already have an established datastore, and a format of how I want the ID to look. I don’t need any help on saving this data, I only need help creating the logic for this system. Every ID will be saved as a StringValue inside of the individual NPC.
When the player joins back, I would want the system to recognize the ID of the last NPC the player created, so that when the player creates a new NPC, it’s ID is one higher than the previous one.
Heres how the ID should look, as well as some examples (x and y stand for the first and last letters of the players name):
Format: XY-00-000
Examples:
FA-00-142
AW-01-260
TT-02-114
Im sorry if this is difficult to understand, I’ll try my best to further explain if you have any questions. Thanks!