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

How to add autosave for this IntValues?

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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.

0
"Waste time" XDDDDD greatneil80 2647 — 6y
0
What do you mean? User#21908 42 — 6y
Ad

Answer this question