local dataStore = DataStoreService:GetDataStore("Oxidation")
local function saveData(player) -- The functions that saves data
local tableToSave = {
player.leaderstats.Hat.Value,
player.leaderstats.shirt.Value
}
local success, err = pcall(function()
dataStore:SetAsync(player.UserId, tableToSave) -- Save the data with the player UserId, and the table we wanna save
end)
if success then
print("Data has been saved!")
else
print("Data hasn't been saved!")
warn(err)
end
end
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Hat = Instance.new("IntValue")
Hat.Name = "Hat"
Hat.Value = 0
Hat.Parent = leaderstats
local Shirt = Instance.new("IntValue")
Shirt.Name = "Shirt"
Shirt.Value = 0
Shirt.Parent = leaderstats
local data -- We will define the data here so we can use it later, this data is the table we saved
local success, err = pcall(function()
data = dataStore:GetAsync(player.UserId) -- Get the data from the datastore
end)
``` I'm posting the rest in the comments cas of bloody word limit :(
#Shirt aint workin :(
1 messages · Page 1 of 1 (latest)
?
there's more and it won't let me paste it
one minute man
k here's the first half of that part
ok or not
or it will say my message couldn't be delivered
because I "don't share a server with the recipient"
WHAT DOES THAT EVEN MEAN?!
what
ok I'm making an acc
I hit create new paste and nothing happened
isn't it supposed to like...
give me a link
instead of just deleting the paste?
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
FINALLY
it made me make an acc
thanks for helping me btw stranger!
game.Players.PlayerRemoving:Connect(function(player) -- When a player leaves
local success, err = pcall(function()
saveData(player) -- Save the data
end)
if success then
print("Data has been saved")
else
**print("Data has not been saved!")**
end
end)
it worked fine when I first made it
now 4 no apparent reason
it doesn't
??????????
ERROR
IF YOU SHOW UP AGAIN
I KNOW WHERE YOUR CHILDREN LIVE
I WILL DELETE THEM
ok now what?
you need to pcall the save function
pcall is for a connection from server to roblox server
like that warn?
oh
I can make it hollow but I can't get rid of it
no seriously in my year of scripting
nobody has ever mentioned warning something
what does this mean
also you're trying to success and err a function that returns nothing
I'm just doing what he told me to
well clearly it's not saving the data-
WDYM STOP USING AI?!
I USED THE HIT FORUM
ROBLOX DEV FORUM
AND READ THE WHOLE THING ON
BLOODY DATASTORES
OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
warn()
OK
OK
THAT'S SO HELPFUL
but also entirely untrue?!
it's right there
blindblox
I got the caps right didn't I?
lemme check
. . .
I am
an idiogt
mazing
thank you strangers.
well just you
the other guy left
thank you wkizi
this is truly
epico
ye- does that really look like AI?
I did copy paste some of it from the
yknow
the forum but like
it was wayyy convienient
made the outfit system meself