TellerMan
|
  |
| Joined: 23 Apr 2010 |
| Total Posts: 237 |
|
|
| 16 Jul 2013 02:20 PM |
I was on Wiki learning about Data persistence and I tried to make a save script.
scoreKey = "PlayerScore"
script.Parent.MouseButton1Down:connect(function(player) local succ, ret = pcall(function() player:SaveNumber(scoreKey, player.leaderstats.Gold.Value) end) if succ then script.Parent.Parent.Output.Text = "Successfully loaded!" script.Parent.Parent.Output.Visible = true wait(5) script.Parent.Parent.Output.Visible = false else script.Parent.Parent.Output.Text = "FAILED to save! Error:" .. ret script.Parent.Parent.Output.Visible = true wait(5) script.Parent.Parent.Output.Visible = false end end)
Whenever I click the save button, the output says:
FAILED to save! Error: Players.TellerMan.PlayerGui.Save/Load.Frame.Save.Script:14:attempt to index upvalue 'player' (a number value)
Any Input on this?? |
|
|
| Report Abuse |
|
TellerMan
|
  |
| Joined: 23 Apr 2010 |
| Total Posts: 237 |
|
| |
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
|
| 17 Jul 2013 09:46 AM |
| You have player as the arguement for a mousebutton1click method... |
|
|
| Report Abuse |
|