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

Questions on Datastore Editor plugin by Crazyman32?

Asked by 6 years ago

Hi guys, there's something i do not get about the editor. I have no problem at the starting area (Defining my PlaceId, Datastore name etc) But I'm quite confuse with the "key" parameter after you've connected. I've gotten a simple datastore service to work, in order to experiment using this plugin here's the code:

ServerScript

Ds = game:GetService("DataStoreService"):GetDataStore("DsName")   
PlayerStats = game:GetService("ServerStorage"):WaitForChild("PlayerStats")

--Creating a leaderboard--
game.Players.PlayerAdded:connect(function(player)
    local playerfolder = Instance.new("Folder",player)      
    playerfolder.Name = "leaderstats"                        

    local point = Instance.new("IntValue", playerfolder)
    point.Name = "points"
    point.Value = Ds:GetAsync(player.UserId) or 0             

    point.Changed:connect(function()                          
        Ds:SetAsync(player.UserId, point.Value)               
    end)
end)

As you can see it's just a simple leaderstats code. I have a part inside my workspace that awards me with points if I touched it. So basically what i want to do is to access the plugin to view my "points" inside the leaderstats. How would I go about doing so? I was typing leaderstats and points inside the plugin but it doesn't seem to be right. (Data persistence did worked for my game.)

0
It's their UserId. Also, please look on the wiki what you are putting in the parameters. hiimgoodpack 2009 — 6y
0
I've looked at his tutorial but it doesn't seem to be the userid. He's typing in things like points and leaderstats: https://www.youtube.com/watch?v=AA_fbfCXv2k (Look @ 2:50). I know that usually we set a key variable to store the UserId but doesn't seem to be the case for this. lesliesoon 86 — 6y

Answer this question