Organization for Local Player IntValues

I want to try and make an xp system. Every time a player kills a mob, they gain xp. My question is how and where would I store my integer for xp. Would I have an IntValue stored in the StarterPack? Would I have a ModuleScript/LocalScript to store the value in?

If you want to store an exp value that a mob gives, I recommend storing the value in an IntValue inside of the mob’s model, and place the model in ServerStorage. The same would apply to any gold or item drops you want this mob to have, you would place them in an IntValue and StringValue respectively.

I recommend using a module script to house any functions that perform necessary operations on the mob, and pull those functions into an initializer script.

Thanks for the reply, what about the xp storage for the player?

I would store the XP IntValue under the player, as it automatically gets cleaned up when the player leaves.

Exp storage in the player will take place in a DataStore, this is something that can be created inside of a script with the following:

local DataStore = game:GetService("DataStoreService")
local [name of your datastore] = DataStore:GetDataStore("[Name of your datastore]")

You can also store various other things in this same DataStore. The DataStore stores a dictionary full of values that you give it, making it a versatile mean of storing data.

However, exercise caution when using DataStores, only access and modify data inside of a pcall() to prevent any data loss.