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)

10 comments
wait nvm you did
i'll try to fix this for you
it's best if you don't use a module script for this as well
oh wait
You
You're correct. I wrote "Leaderstats" instead of "leaderstats". I didn't know if the capital l mattered
You're correct. I wrote "Leaderstats" instead of "leaderstats". I didn't know if the capital l mattered
BRUH, IT TAKES 100 YEARS FOR IT TO LOAD
Well, it shows now, but it doesn't save :\
Okay, it saves now :D