#progress saving

1 messages · Page 1 of 1 (latest)

round venture
#

I need help on how to make my game save player progress, there is an inventory system that needs to be saved and a personal structure that they customise and expand that needs to be saved currently, I asked the ai assistant but it didn't rly help much can someone give me a hand

dawn gladeBOT
#

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

dire lotus
#

datastores

round venture
dire lotus
#

🙂

round venture
dire lotus
round venture
dire lotus
#

Weird how we're still having this conversation instead of going our separate ways, and for you, a Google search

#

do some fucking research you fat prick

#

lazy ass bum

sly kestrel
#

or he's just new

#

💔

#

i got you sponge give me some time to research

dire lotus
#

new to Google searching?

#

nah, let him do it himself

#

it's good for him

sly kestrel
#

whats hard about explaining a solution, you're calling him a fat prick only because he didn't google something, chill out

dire lotus
#

I'd call him a fat prick any time tbf

#

I hate people who refuse to use resources

#

so incessant about demanding something from people

sly kestrel
#

@round venture are you saving tools in your inventory, and how are "structures" built?

round venture
round venture
dire lotus
tawny lantern
#

roblox is best used with data oriented designs

#

you can't save objects nor its reference but an id to identify what it is

round venture
dire lotus
#

I'm going to assume that you haven't

round venture
#

How bored are you 😭😭

dire lotus
#

As far as the structure goes, you can consider buffers

dire lotus
tawny lantern
#

comt is not wrong with being self sufficient but his way of saying it is out of line

dire lotus
#

out of line how?

#

was it the fat prick comment

tawny lantern
#

yea there's no point in being rude

round venture
#

Just unnecessary

dire lotus
#

sure there is, otherwise why would I

#

it makes me feel better about talking to him, so I think it's worth it

round venture
#

Your self worth that low you gotta insult ppl to make it worth talking to them ? 😭

dire lotus
#

self worth? This isn't about me, it's about you

round venture
dawn gladeBOT
#

studio** You are now Level 2! **studio

dire lotus
#

Yeah, I gotta take ownership of some of it 🙂

round venture
#

all U had to do was j ignore the ticket bro didn't mean to offend you by asking 😭

dire lotus
#

nah I go through some of these to give written solutions, just not to become a whole ass dictionary

#

if you want to know something, please take initiative

safe sorrel
#

yo so if u need the server side script i can give it from one of my old games

safe sorrel
#

i will it in parts since the full script is to long

round venture
#

Okay Ty

safe sorrel
#

local ds = game:GetService("DataStoreService")
local dms = ds:GetDataStore("dms")
-- get the values that u want to save

game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr

--make the values u want to save in the leaderstats

local value = Instance.new("IntValue") -- smth like this
value.Name = "Value"
value.Parent = leaderstats

local plrUserId1 = tostring(plr.UserId)-- get the player's user id 

    local data = dms:GetAsync(plrUserId1)--get the player's data
    if data then
    else
        print("data was not found")
    end
end)
#

this is the first part

dire lotus
safe sorrel
#

game.Players.PlayerRemoving:Connect(function(plr)
local plrUserId2 = tostring(plr.UserId)-- get the userid
local dataToSave = { -- put the plr's data that u want to save
}
if dataToSave == true then
dms:SetAsync(plrUserId2, dataToSave)
else
print("data did not save")
end
end)

dawn gladeBOT
#

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

safe sorrel
#

but it still works pretty well with out it

safe sorrel
dire lotus
#

if dataToSave == true will always be false in your code

tawny lantern
#

this script is a mess

tawny lantern
#

use this

safe sorrel
#

but it is better than nothing

#

either way i made it a long time ago

tawny lantern
#

and the last player will never get their data saved

dire lotus
#

I also want to point out that saving players in a FIFO order on bindtoclose is sufficient to ensure activation of setasync