generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Save

Previous Thread :: Next Thread 
TellerMan is not online. 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 is not online. TellerMan
Joined: 23 Apr 2010
Total Posts: 237
17 Jul 2013 09:44 AM
Bump.
Report Abuse
comiconor is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image