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

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

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

✓ Accepted answer

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

10 comments

0

wait nvm you did

0

i'll try to fix this for you

0

it's best if you don't use a module script for this as well

0

oh wait

0

You

0

You're correct. I wrote "Leaderstats" instead of "leaderstats". I didn't know if the capital l mattered

0

You're correct. I wrote "Leaderstats" instead of "leaderstats". I didn't know if the capital l mattered

0

BRUH, IT TAKES 100 YEARS FOR IT TO LOAD

0

Well, it shows now, but it doesn't save :\

0

Okay, it saves now :D

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