#Does anyone know how to save script-created values?
1 messages · Page 1 of 1 (latest)
to save values for players even after they leave the server and join another , you need to use the datastore service, note that datastoreservice can only be accessed from server scrips and is saved and loaded through server scripts.
i know. im trying to make an datastore for an script-made value.
the script made value is when
YOU buy something, and to make the character save
the script that makes the datastore
must save the script-made value
like
kinda brain aint braining
by saying "script made value" do you mean a variable declared in the script?
yes
like
when you buy something
an different script gets triggered
and makes an value
which when you leave
that value gets into the player
and gets saved by the datastore script
basically
im making an character saving system.
you buy a character
it gets into an slot
then when the player leaves
the script made value with the character's info
gets saved by the datastore script.
so like the datastore script saves money and the script made value
alr so say when the player join, you create an empty table
and each time the player purchases a new character that character gets saved into that table(added)
once the player leaves, that table gets saved to datastore
do you know how to achieve this?
but how do i add the character and its slot's info to the table
how familiar are you with tables
25%
yikes
in one sentence
u can see m helping dude
u are both explaining badly
you first gota learn how tables work
since you are saving a bunch of purchased characters
basically, when you buy a character, it gets into your base, so it gets into an slot, which i wanna use an table to save the character's info and its slot, so each time you buy a character, it gets into the table to save.
ok
set in mind that a table itself can contain tables
table[slot] = {character_info, slot}
?? idk if thats what ur looking for
SOMETHING LIKE THAT
ya
but an table gets added
what are u making a table out of us
that makes a table alreadcy
it's a array of [1] character info and [2] slot
oh i forgot mb
read bottom one
guess get slapped with ressources
if these do not help ping me
aight
for not slapping with ressources the second a question is asked? agreed
ur a skid
nah but id rather give a good explaination first