Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I save a character model?

I am trying to make a character customization that you can only use once and it saves, however I have no idea on how to make the character save when it leaves or resets character. Pls help :)

11 comments

0

Do NOT ask the same question within a short span of time.

0

but it isn't the same question

0

you could save the accessories to data store, thats all wowowow i wont help you script everything im not that gentle

0

:'|

0

I can show you the script, but which script?

0

about datastores its easy part, if you understand the concept then its a yes

0

Thanks, I will look in to it :)

0

ive made an answer i hope you understand it i tried my best, read everything dont be lazy and data store isnt that super complicated big brained pro moment genius would understand, its only save data and load data

0

theres no hyperlink on chat dont worry

1 answer

datastores are thing that saves to roblox api service, used for saving datas like player left and rejoin and have the same thing the first thing you should do is set up a data store, its simple: (actually you dont need to set up, you can just index it or lazy make a variable about it, i didnt because i am also lazy)

local MyDataStore = game:GetService("DataStoreService"):GetDataStore("myDataStore")

to save datastores, use :SetAsync or :UpdateAsync, and the arguments (like what you should put) are keys, (keys must be specific between each user) and value you want to save, heres an example

game:GetService("DataStoreService"):GetDataStore("myDataStore"):UpdateAsync("Key".. player.UserId, 100) -- UPDATES to 100 value with the given key

what about, getting the data??? you shouldnt just save the data and leave it alone, its like wasting time, to get the data use :GetAsync() and the arguments are keys, no value needed because you are getting it

heres some example

game:GetService("DataStoreService"):GetDataStore("myDataStore"):UpdateAsync("Key".. player.UserId, 100) -- UPDATES to 100 value with the given key

game:GetService("DataStoreService"):GetDataStore("myDataStore"):GetAsync("Key".. player.UserId") -- 100 wowoowowowowo except you got an error because timeout

hey, forgot to mention this, but data store might NOT SAVE 100% all the time, its because api service being noob, so thats why you should use UpdateAsync, so values still save from last play

heres some way to prevent:

  • use a code to detect error, if it gets error save it again and if it gets error again then just ignore it lol

  • save the data like every minute, dont save it like 1 second, about some detailed explaination then click here, if you are terrified with hyperlink then copy this https://developer.roblox.com/en-us/articles/Datastore-Errors

  • no idea now

and last thing, very important, dont use UpdateAsync like super often like every 1 second because api service is gonna die if you set it too often (not actually die, i dont have anything else to say), but just like save it every 30 seconds, and save it once if player left, or twice

bye

8 comments

0

whenever you see an upvote, you see that Xapelize answered it

0

I am still confused. Where to start and what to do?

0

How do I do it?

0

This is my script*

0

local MyDataStore = game:GetService("DataStoreService"):GetDataStore("myDataStore") game.Players.PlayerAdded:Connect(function(player) game:GetService("DataStoreService"):GetDataStore("myDataStore"):UpdateAsync("Key".. player.UserId, 100) -- UPDATES to 100 value with the given key end) game.Players.PlayerRemoving:Connect(function(player) game:GetService("DataStoreService"):GetDataStore("myDataS

0

chill you got me so many notifications

0

wait not you

0

wait not you

This discussion is preserved as it was. New answers, comments, and votes are closed.