#question

100 messages · Page 1 of 1 (latest)

median thistle
#

And there's not much you can do about that

woeful trellis
#

Like imagine pet sim x, there must be hundreds of prevented datalosses

#

Ahh so like it crashes while updating?

median thistle
woeful trellis
#

But like imagine if a player joins the game and all their datas lost imagine how devastating that would be 💀

median thistle
woeful trellis
median thistle
#

It will just revert back to the last save

woeful trellis
median thistle
# woeful trellis Wait dead ah?

You would need to write a small function for that to make sure it does it every time( doesn't just load blank data) but yeah

woeful trellis
median thistle
woeful trellis
#

Yes

#

Cause it's a table

#

I'm I screwed?

median thistle
#

Yeah but that will cause a huge saving load if you have a lot of values to save

woeful trellis
#

Like there's tables in each key
{Coins = 1, Pet= false}

median thistle
#

Which could lead to datastore overloads, which causes data loss

woeful trellis
#

Like one time purchase pets, so true if they own it and false if they dont

median thistle
woeful trellis
#

💀

median thistle
woeful trellis
median thistle
#

But instead of doing it every time one value changes, just cycle save jt

median thistle
#

while task.wait(5) do

median thistle
woeful trellis
woeful trellis
woeful trellis
#

And so when I buy a pet, it saves all my pets and saves all the numb and string values in the other datastore

woeful trellis
median thistle
#

Bad

#

Don't have two different datastores

#

Unless you REALLY REALLY have to because of data overload, don't

woeful trellis
#

Well I'm doing this cause of data overload

#

Because think about it

woeful trellis
#

When I buy a pet, I update the number of coins and the pet at the same time, which will overload the key

#

I got an idea, what if I update two different keys, one storing the pets and one storing all the other things

median thistle
#

Overload occurs when you're trying to save too much data in very little time

woeful trellis
#

so my setup works such that
IF any of these values update it will update the entire key
and the issue, lets say u buy a pet, ur overloading the key as ur tryna update it two spontaneous times when two things are updating

median thistle
#

For example,

while task.wait(.1) do -- will overload 
--savd data
end


function SaveGame()
local savetable = {}
for i,v in game:Getdescendants do
table.Insert(savetable, v.BrickColof)
end
-- save table
end
#

The second function won't overload even though it's saving a shit ton of data

#

Unless you save it very frequently

woeful trellis
#

cause im tryna save it to the same key

woeful trellis
#

yes i did try this and it did overload; not cycle saving

woeful trellis
woeful trellis
median thistle
median thistle
woeful trellis
# median thistle Whatever time you want

well except lets say they buy a pet right? then i update their bits, then it waits 5 to update, but if they leave in those 5 seconds then they lose bits but they dont get the pet

#

or if they buy a pet, then i get it, but the bits dont mark as disappeared till 5 secs later

median thistle
woeful trellis
median thistle
woeful trellis
#

dies

median thistle
#

Your problem is that the server closes before you can save

#

Just do this

woeful trellis
#

bind to close? i literally swear

median thistle
#

game:BindToClose(function()
task.wait(.5)
end)

#

That should give it time to save

woeful trellis
median thistle
#

Players.PlayerRemoving?

woeful trellis
#

OHHH

#

i put that in the bind to close?

#

or outside?

#

💀

median thistle
median thistle
woeful trellis
woeful trellis
quiet linden
#

i use both bindtoclose and playerremoving

woeful trellis
quiet linden
woeful trellis
ornate wagon
#

like in 1 update coins has the problem but another update time has the problem

#

idk just wanted to say that

woeful trellis
ornate wagon
#

and they both have to be in the same server

#

lmfao

woeful trellis
#

💀

median thistle