gunter5
|
  |
| Joined: 15 Mar 2011 |
| Total Posts: 737 |
|
|
| 31 Oct 2016 10:48 PM |
Output: Workspace.DataStorage:106: bad argument #3 to 'Value' (string expected, got nil)
local DataStore = ga###################################################################### game.Players.PlayerAdded:connect(function(player) local key = "user_" .. player.userId local savedstats = DataStore:GetAsync(key) local PlayerLevel = Instance.new("IntValue", player) PlayerLevel.Name = "PlayerLevel" PlayerLevel.Value = 1 local PlayerName = Instance.new("StringValue", player) PlayerName.Name = "PlayerName" PlayerName.Value = "NoName" local NewPlayer = Instance.new("BoolValue", player) NewPlayer.Name = "NewPlayer" NewPlayer.Value = true local StrengthStat = Instance.new("IntValue", player) StrengthStat.Name = "StrengthStat" StrengthStat.Value = 0 local AgilityStat = Instance.new("IntValue", player) AgilityStat.Name = "AgilityStat" AgilityStat.Value = 0 local KiStat = Instance.new("IntValue", player) KiStat.Name = "KiStat" KiStat.Value = 0
local ExpLevel = Instance.new("IntValue", player) ExpLevel.Name = "ExpLevel" ExpLevel.Value = 0 local MaxExpLevel = Instance.new("IntValue", player) MaxExpLevel.Name = "MaxExpLevel" MaxExpLevel.Value = 100
if savedstats then PlayerLevel.Value = savedstats[1] PlayerName.Value = savedstats[2] -- Getting Error Here. NewPlayer.Value = savedstats[3] StrengthStat.Value = savedstats[4] AgilityStat.Value = savedstats[5] KiStat.Value = savedstats[6] ExpLevel.Value = savedstats[7] MaxExpLevel.Value = savedstats[8] else local statstosave = {PlayerLevel.Value, PlayerName.Value, NewPlayer.Value, StrengthStat.Value, AgilityStat.Value, KiStat.Value, ExpLevel.Value, MaxExpLevel.Value} DataStore:SetAsync(key, statstosave) end end)
game.Players.PlayerRemoving:connect(function(player) local key = "user_" .. player.userId local savedstats = DataStore:GetAsync(key) local statstosave = {player.PlayerLevel.Value, player.PlayerName.Value, player.NewPlayer.Value, player.StrengthStat.Value, player.AgilityStat.Value, player.KiStat.Value, player.ExpLevel.Value, player.MaxExpLevel.Value} end) |
|
|
| Report Abuse |
|
|
| 31 Oct 2016 10:53 PM |
i cant read this code help
|
|
|
| Report Abuse |
|
gunter5
|
  |
| Joined: 15 Mar 2011 |
| Total Posts: 737 |
|
| |