Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- The purpose of this system is simple. It stores player data in
- databases, and retrieves player data from databases. Acts as an
- interface between Magic system, NPC system, Stamina system, etc.
- The updater ties act as the middle man between the database and
- other scripts that are client side (The gui scripts, aura scripts, etc).
- Naming conventions for database scripts will follow SQL conventions:
- https://www.xaprb.com/blog/2008/10/26/the-power-of-a-good-sql-naming-convention/
- --]]
- local master_key = "player_user_data"
- local DataStore2 = require(1936396537)
- DataStore2.Combine(
- master_key,
- "MISSION_DATABASE",
- "BACKPACK_DATABASE",
- "INVENTORY", -- holds non tools
- "PLAYER_COINS", -- holds player gold coins and blackstone fragments
- "MAX_STAMINA",
- "MAX_AURA",
- "PLAYER_LEVEL",
- "PLAYER_RANK",
- "PLAYER_INFLUENCE",
- "PLAYER_ENEMIES",
- "PLAYER_ALLIES",
- "PLAYER_ALLIANCES"
- )
- local table = require(game.ReplicatedStorage.ModuleScripts.table)
- local player_userdatas = {}
- game.Players.PlayerAdded:Connect(function(player)
- local player_userdata = {}
- player_userdata.mission_database = DataStore2("MISSION_DATABASE", player)
- player_userdata.backpack_database = DataStore2("BACKPACK_DATABASE", player)
- player_userdata.inventory = DataStore2("INVENTORY", player)
- player_userdata.player_coins = DataStore2("PLAYER_COINS", player)
- player_userdata.max_stamina = DataStore2("MAX_STAMINA", player)
- player_userdata.max_aura = DataStore2("MAX_AURA", player)
- player_userdata.player_level = DataStore2("PLAYER_LEVEL", player)
- player_userdata.player_rank = DataStore2("PLAYER_RANK", player)
- player_userdata.player_influence = DataStore2("PLAYER_INFLUENCE", player)
- player_userdata.player_enemies = DataStore2("PLAYER_ENEMIES", player)
- player_userdata.player_allies = DataStore2("PLAYER_ALLIES", player)
- player_userdata.player_alliances = DataStore2("PLAYER_ALLIANCES", player)
- player_userdatas[player.UserId] = player_userdata
- end)
Advertisement
Add Comment
Please, Sign In to add comment