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 Script

Previous Thread :: Next Thread 
TRRxSL4YER is not online. TRRxSL4YER
Joined: 23 Dec 2011
Total Posts: 119
06 Aug 2012 12:30 PM
When I put this Script in my screen GUI button it doesnt save. It is supposed to Save the Levels Completed. I need fixing on the Load one to but I dont want to post two because it will be too long. Hope someone can fix it thanks!

function SaveScore(plyr, score)
plyr:SaveNumber("Levels Completed", score) --Change KO's to whatever your leaderstats is. Like "Money" or something.
end

function onClicked()

player = script.Parent.Parent.Parent.Parent.Parent
player:WaitForDataReady()
if player.DataReady == true then
SaveScore(player, player.leaderstats:findFirstChild(script.Parent.Parent.Parent.Configuration.Type.Value).Value)
m = Instance.new("Message",player.PlayerGui)
m.Text = script.Parent.Parent.Parent.Configuration.Type.Value.. " Saved" -- Let's them know the stats are saved.
game:service("Debris"):AddItem(m, 3)
else
m = Instance.new("Message",player.PlayerGui)
m.Text = "Waiting untill DataReady..."
game:service("Debris"):AddItem(m, 3)

end
end

script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
06 Aug 2012 12:48 PM
Post output, Check script type, Also, if it is in a GUI then script.Parent.MouseButton1Click Might not work but that all depends on the parent so check that too.
Report Abuse
TRRxSL4YER is not online. TRRxSL4YER
Joined: 23 Dec 2011
Total Posts: 119
06 Aug 2012 12:57 PM
Okay Thanks
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