#Tycoon Datastorage

15 messages · Page 1 of 1 (latest)

high mica
#

yes

#

u have a leaderboard? @hollow bloom

#

like leaderstats

hollow bloom
#

yeah i do

high mica
#

ok

#

ima send u a tutorial

#

@hollow bloom

hollow bloom
#

ok

high mica
#

Advanced Roblox Scripting Tutorial #13 - Data Store / Saving Player Data (Beginner to Pro 2019)

Hey guys, i know i've been gone for a while and i apologize for that but I am back and in today's video i am going to be teaching you guys about data stores and how they work. Basically saving player data. Anyways this a very long tutorial which is m...

▶ Play video
hollow bloom
#

does it show how to save the droppers tho

obtuse brook
#

it shows how to save everything

hollow bloom
#

ok

sonic orchid
#

studio** You are now Level 1! **studio

hollow bloom
#

local DataStoreService = game:GameService("DataStoreService")
local my DataStore = DataStoreService:GetDataStore("myDataStore")

game.Players.PlayerAdded:Connect(function(player)

leaderstats.Name = "leaderstats"
leaderstats.Parent = player    

local Cash = Instance.new("IntValue")
Cash.Name = "Cash"
Cash.Parent = leaderstats

local playerUserId = "Player_"..player.UserId

Local data
local sucess, errormessage = pcall(function()
    data = myDataStore:GetAsync(playerUserId)
end)

if sucess then
    Cash.Value = data

end

end)

game.Players.PlayersRemoving:Connect(function(player)
local playerUserId = "Player_"..player.UserId

local data = player.leaderstats.Cash.Value

local sucess, errormessage = pcall(function()
    myDataStore:SetAsync(playerUserId, data)
end)

if sucess then
    print(:Data sucessfully Saved!")
else
    print(There was an error!")
    warn(errormesssage)
end

end)

#

this is the datastore i made for my cash