Hello! I have been trying at this for a while now, and I can't seem to find a way to do this. Can someone help me out with fixing this script to save the two leaderboard values called "Money", "Experience", and "Bombs"?
local DataStoreService = game:GetService("DataStoreService")
local Money = DataStoreService:GetDataStore("Money")
-- Data store key and value
local playerUserID = 505306092
local playerGold = 250
-- Set data store key
local setSuccess, errorMessage = pcall(function()
Money:SetAsync(playerUserID, playerGold)
end)
if not setSuccess then
warn(errorMessage)
end
-- Read data store key
local getSuccess, currentGold = pcall(function()
return Money:GetAsync(playerUserID)
end)
if getSuccess then
print(currentGold)
end
