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

Why doesn't my leaderboard show up in studio? (Datastore2)

Asked by 3 years ago

I'm using Datastore 2 and I followed AlvinBlox's tutorial, but while I'm in studio, my Coins don't show. I turned on "Enable Studio Access to API services" and I added a BoolValue named SaveInStudio that's set to true. It still doesn't show up. If I turn off "Enable Studio Access to API services", then I'll get errors saying HTTP 403. If it is on, then there is no errors, but it doesn't do anything in studio.

Code:

local DS2 = require(script.Parent.MainModule)
local DefaultValue = 0

game.Players.PlayerAdded:Connect(function(plr)
    local coinsDS = DS2('Coins', plr)
    local leaderstats = Instance.new('Folder', plr)
    local coins = Instance.new('IntValue', leaderstats)

    leaderstats.Name = 'Leaderstats'
    coins.Name = 'Coins'

    local function updateCoins(updatedValue)
        coins.Value = coinsDS:Get(updatedValue)
    end

    updateCoins(DefaultValue)
    coinsDS:OnUpdate(updateCoins)
end)

1 answer

Log in to vote
0
Answered by 3 years ago

You didn't name the leaderstats folder to "leaderstats"

0
wait nvm you did jorcorrs 76 — 3y
0
i'll try to fix this for you jorcorrs 76 — 3y
0
it's best if you don't use a module script for this as well jorcorrs 76 — 3y
0
oh wait Hoogidy_Boogidy 18 — 3y
View all comments (6 more)
0
You Hoogidy_Boogidy 18 — 3y
0
You're correct. I wrote "Leaderstats" instead of "leaderstats". I didn't know if the capital l mattered Hoogidy_Boogidy 18 — 3y
0
You're correct. I wrote "Leaderstats" instead of "leaderstats". I didn't know if the capital l mattered Hoogidy_Boogidy 18 — 3y
0
BRUH, IT TAKES 100 YEARS FOR IT TO LOAD Hoogidy_Boogidy 18 — 3y
0
Well, it shows now, but it doesn't save :\ Hoogidy_Boogidy 18 — 3y
0
Okay, it saves now :D Hoogidy_Boogidy 18 — 3y
Ad

Answer this question