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

how do i save stats?

Asked by
lyxture 27
8 years ago

script game.Players.PlayerAdded:connect(function(plr) local stats = Instance.new('IntValue', plr) stats.Name = 'leaderstats' local experience = Instance.new('IntValue', stats) experience.Name = 'EXP' experience.Value = 0 local level = Instance.new('IntValue', stats) level.Name = 'level' level.Value = 0 experience.Changed:connect(function() level.Value = math.floor(experience.Value / 10) spawn(function() while true do wait(3) experience.Value = experience.Value +1 end end) end) end)

how do i make a script so that it saves my script? with that i mean so if a player plays the game and leaves his experience value wil be saved.

1
What you need is DataStore. Go to this wiki page, read it. Try to code it, if you get stuck, return here and leave a comment. http://wiki.roblox.com/index.php/Data_store LetThereBeCode 360 — 8y
0
thank you for youre help lyxture 27 — 8y

Answer this question