--[[
================================================== Copyright Valor 2022-2023, All rights reserved ==================================================
====================================================================================================================================================
================================================================== 22 April, 2022 ==================================================================
== PURPOSE: This is where the main game's database is, this is used for both versions of the game (compaign and multiplayer). In short; you can
find (and I'm certain) the entire game's saving, setup (etc.) data.
--]]
-- DataStoreService
local DataStoreService = game:GetService("DataStoreService")
-- Data Stores
local GameData = DataStoreService:GetDataStore("GameData") -- Main; singleplayer, campaign
local MultiData = DataStoreService:GetDataStore("MultiplayerData") -- Multiplayer
local ItemData = DataStoreService:GetDataStore("ItemGameData") -- Items; inventory
-- DataTypes (Request)
local UpdateAsync = Enum.DataStoreRequestType.UpdateAsync
-- BoolVars
local Autosave = false
local default = {
SessionLock = false,
Cash = 0
}
local function WaitForBudgetRequest()
local CurrentBudget = DataStoreService:GetRequestBudgetForRequestType(UpdateAsync)
while CurrentBudget < 1 do
CurrentBudget = DataStoreService:GetRequestBudgetForRequestType(UpdateAsync)
wait(5)
end
end
-- PURPOSE: This is the function automatically used whenever someone joins the game; Setup
local function Setup(player)
local Name = player.Name
local key = "user_" .. player.UserId
-- Currency:
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
-- Main:
repeat
WaitForBudgetRequest()
Om dit project op uw website in te sluiten, kopieer de volgende code en plak deze in de HTML van uw website: