LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 04 Oct 2013 08:41 PM |
This is my script, it would not save or load:
function enter(pl) repeat wait() until pl pl:waitForDataReady() local stats = Instance.new("IntValue") stats.Parent = pl stats.Name = "leaderstats" local k = Instance.new("IntValue") k.Parent = stats k.Name = "Kills" k.Value = 0
local ks = Instance.new("IntValue") ks.Parent = stats ks.Name = "KillStreak" ks.Value = 0 local lv = Instance.new("IntValue") lv.Parent = stats lv.Name = "Level" if not pcall(function() lv.Value = player:LoadNumber("Level") end) then lv.Value = 1 end local xp = Instance.new("IntValue") xp.Name = "Exp" if not pcall(function() xp.Value = player:LoadNumber("XP") end) then xp.Value = 0 end xp.Parent = stats end
game.Players.PlayerAdded:connect(enter)
game.Players.PlayerRemoving:connect(function(player) player:SaveNumber("Level", player.leaderstats.Level.Value) player:SaveNumber("XP", player.leaderstats.Exp.Value) end) |
|
|
| Report Abuse |
|
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
| |
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
| |
|
LV1Z
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 652 |
|
|
| 04 Oct 2013 10:28 PM |
i cri for 10 hrs strate ;-; y u do dis,
but seriously, how would you save a Number data when the player leaves? |
|
|
| Report Abuse |
|
|