Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to add autosave for this IntValues?

ik i asked this before but nobody cared about it so im reposting it

lines 1 - 12: Creates IntValues lines 14 - 17: Gives one level for every 100 EXP

game.Players.PlayerAdded:connect(function(plr)
 local stats = Instance.new("IntValue", plr)
 stats.Name = "leaderstats"
 local EXP = Instance.new("IntValue", stats)
 EXP.Name = "EXP"
 EXP.Value = 0
 local level = Instance.new("IntValue", stats)
 level.Name = "Level"
 level.Value = 0
 local Souls = Instance.new("IntValue", stats)
 Souls.Name = "Souls"
 Souls.Value = 0

 EXP.Changed:connect(function()
  if EXP.Value == 100 then
  EXP.Value = 0
  level.Value = level.Value + 1
  end
  end)
end)

1 answer

Here are some links to good answers to your problem. It is a big topic that has already been answered so I won't waste time typing out a long answer.

http://wiki.roblox.com/index.php/Data_store

http://wiki.roblox.com/index.php?title=Saving_Player_Data

https://devforum.roblox.com/t/help-with-datastores/72001

I hope this will help you. Also if you have any more specific questions post them in the comments below my answer and I will try to help you. Your current question is to general to answer here.

2 comments

0

"Waste time" XDDDDD

0

What do you mean?

This discussion is preserved as it was. New answers, comments, and votes are closed.