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

How to make global game stats?

Asked by 5 years ago

I'd like to see how many minigames have been loaded altogether I'd like to do something like a global value that gets the data from each server does anyone know how to do that?

0
HttpService User#19524 175 — 5y
0
or datastore ^^ User#20388 0 — 5y
0
Yes, but how do I make a global value with httpservice MageMasterHD 261 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

do this in the script that loads the minigames

local key = 1234 -- put anything here
local ds = game:GetService("DataStoreService"):GetDataStore("Put anything here")


function UpdateValue()
if ds:GetAsync(key) then
ds:SetAsync(key, ds:GetAsync(key) + 1)
end
end

-- when a new minigame starts do this
UpdateValue()
Ad

Answer this question