caviarbro
(caviarbro)
March 25, 2021, 10:57pm
#1
Hello Devs I have been wondering how I am able to achieve “Global Values” I dont really know how to name or explain it but I will show example here:
What do I mean is the Total Hatched Value.
(This image is taken in Rumble Studios Discord server)
Thanks for any ideas how would I go about it since I have no clue.
Chrofex
(Chrofex)
March 25, 2021, 11:14pm
#2
You can just save the global value in a datastore in a specific key or you can have an external datastore that stores the value and is updated using httpservice when you want it to be updated.
1 Like
caviarbro
(caviarbro)
March 25, 2021, 11:41pm
#3
Okay so I will create basically datastore without player userid key in it and I will access this value similiar how I can for player?
player.leaderstats.Coins.Value --player
game.leaderstats.Coins.Value --global?
Chrofex
(Chrofex)
March 25, 2021, 11:43pm
#4
Yes you can use any unique key to store the value in a datastore,
DataStore:GetAsync("GlobalCoinKey")
DataStore:SetAsync("GlobalCoinKey",CoinValue)
But you have to be careful of how many times you write and access this key because there are time limitations.
caviarbro
(caviarbro)
March 25, 2021, 11:52pm
#5
Alright thank you so much I am marking your post as a solution so other people can see it.
Have a great day !
1 Like