Hello i need help how to make leaderstats with data save or data store but i know how to make leaderstats except data save don’t know how to do it
Open Roblox Studios → Game Settings → Security → Enable Studio Access to API Services
It will then save the data of your game, no need to add any script.
Why does that look like an AI generated reply bro…
Anyways that’s NOT how you use datastores.
You need to use datastores by using DataStoreService.
Read the documentation.
What about global leaderboard it will save too?
First of all, this is the wrong category, please move this to #help-and-feedback:scripting-support.
That user is wrong, you need to have a script to save and load data.
Here is an examp
local RemoteEvents = game.ReplicatedStorage.RemoteEvents
local HTTPService = game:GetService("HttpService")
local LegalAct = RemoteEvents.LegalAct
local msgS = require(game.ReplicatedStorage.MessageSender)
local DataStoreService = game:GetService("DataStoreService")
local LegalStore = DataStoreService:GetDataStore("LegalStoreA1")
LegalAct.HasAgreed.OnServerInvoke = function(player)
local success,data = pcall(function()
return LegalStore:GetAsync("Legalities")
end)
if success and data then
if table.find(HTTPService:JSONDecode(data),player.UserId) then
return true
end
end
return false
end
LegalAct.Agreed.OnServerEvent:Connect(function(player)
local success,data = pcall(function()
return LegalStore:GetAsync("Legalities")
end)
if success then
if data then
data = HTTPService:JSONDecode(data)
table.insert(data,player.UserId)
msgS.Embed(player,"Contract Agreement","Player agreed to TOS.","I")
else
data = {player.UserId}
end
end
LegalStore:SetAsync("Legalities",HTTPService:JSONEncode(data))
end)
I made this for my game but this basically helps you understand how datastore works.
It’s not though, but it works for me
they are because they said that udon’t need any script while u do. they only told you how to enable data store api.
DataStoreService basically saves anything but if you want to make a global leaderboard that is ordered then you need OrderedDataStoreService. Its like a subsection of DataStoreService,
Learn more here:
Thanks you very much for telling me how to do it
No problem! Let me know if you have any other issues and I’ll happily fix them.