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

How would I give myself stats from my Datastore2?

I wanna use the command line to add 30,000 time (my stat on my DataStore2), but I'm not sure. If anyone can help. This is what I have right now.

local myUserId = (your user id)
if player.UserId == myUserId then
  player:Increment(30000)
end

Someone please help...

1 answer

Ok. So what you want to do is change the script a bit:

local DataStoreService = game:GetService("DataStoreService")
local DS = DataStoreService:GetDataStore("SavaSystem1")
local myUserId = (your user id)
if player.UserId == myUserId then
    player.leaderstats.Credits.Value = player.leaderstats.Credits.Value
    DS:SetAsync(player.UserId, player.leaderstats.Credits.Value)
end

Hope this helped! IF it doesn't give me a message or comment and I'll give you another answer.

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