local ds = game:GetService("DataStoreService"):GetGlobalDataStore("Valor") game.Players.PlayerAdded:connect(function(player) local stats = Instance.new("IntValue", player) stats.Name = "leaderstats" local valor = Instance.new("IntValue", stats) valor.Name = "Valor" if ds:GetAsync(player.userId) ~= nil then valor.Value = ds:GetAsync(player.userId) end while true do ds:SetAsync(player.userId,valor.Value) end end)
Lookie here,
I've been reviewing the wiki, watching YouTube videos, and checking out other developers' uncopylocked games for hours now.
So help would be GREATLY appreciated.
So the purpose of this script is to save the IntValue "Valor", which it does. However, the catch is I am trying to save it across several games.
What I'm looking for here is an explanation as of to how the entire universe thing works, and as of to how to make this work across several games.
Fix: That while loop isn't very good, it'll just lag the player. Instead, make it a .Changed
event:
valor.Changed:connect(function() ds:SetAsync(player.UserId,valor.Value) end)
To answer your question:
Wiki article: http://wiki.roblox.com/index.php?title=Game
You shouldn't need to do anything special, DataStores carry across universes. Just make sure to put that script into every place in the universe.
Hopefully this helped, if you need anything, tell me in the comments!
~TDP