Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 08 Mar 2015 03:54 AM |
Testing my game online (The "Play" Button). I always look in the server console for scripting errors. I see an error:
"Argument 1 Missing or nil"
in this line:
mm.Text = DataStore:GetAsync(key)
While the whole script looks like this:
local mm = Instance.new("Message", workspace) local DataStore = game:GetService("DataStoreService"):GetDataStore("Coins")
game.Players.PlayerAdded:connect(function(player) key = "user_" .. player.userId DataStore:UpdateAsync(key, function(oldValue) local newValue = oldValue or 0 newValue = newValue + 5 return newValue end) end)
repeat wait() if _G.gameFinished == true then DataStore:UpdateAsync(key, function(oldValue) local newValue = oldValue or 0 newValue = newValue + 20 return newValue end) end mm.Text = DataStore:GetAsync(key) until 1 == 0
I am very new to data stores... |
|
|
| Report Abuse |
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 08 Mar 2015 04:02 AM |
Sorry, did something TOTALLY wrong. Fixing it myself! Ignore this thread! |
|
|
| Report Abuse |
|