Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I save a character model?

Asked by 3 years ago

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 :)

0
Do NOT ask the same question within a short span of time. radiant_Light203 1166 — 3y
0
but it isn't the same question FireTap1 12 — 3y
0
you could save the accessories to data store, thats all wowowow i wont help you script everything im not that gentle Xapelize 2658 — 3y
0
:'| FireTap1 12 — 3y
View all comments (7 more)
0
I can show you the script, but which script? FireTap1 12 — 3y
0
about datastores its easy part, if you understand the concept then its a yes Xapelize 2658 — 3y
0
Thanks, I will look in to it :) FireTap1 12 — 3y
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 Xapelize 2658 — 3y
0
theres no hyperlink on chat dont worry Xapelize 2658 — 3y

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

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

0
whenever you see an upvote, you see that Xapelize answered it Xyternal 247 — 3y
0
I am still confused. Where to start and what to do? FireTap1 12 — 3y
0
How do I do it? FireTap1 12 — 3y
0
This is my script* FireTap1 12 — 3y
View all comments (4 more)
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 FireTap1 12 — 3y
0
chill you got me so many notifications Xapelize 2658 — 3y
0
wait not you Xapelize 2658 — 3y
0
wait not you Xapelize 2658 — 3y
Ad

Answer this question