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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
30 Jul 2014 11:24 AM
So i want this

When you leave the game, a leaderstats called stars is saved
When you join the game, it loads your stars
AUTOMATICALLY.


And 1 More Thing
How do you clear all Datastores that have been made on the game?
Report Abuse
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
30 Jul 2014 11:34 AM
hello my friend
Report Abuse
PancakeChop is not online. PancakeChop
Joined: 14 May 2010
Total Posts: 3060
30 Jul 2014 11:36 AM
[ Content Deleted ]
Report Abuse
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
30 Jul 2014 11:45 AM
If you want to help me, you can do it for free if you like.
Anyone willing to help?
Report Abuse
PancakeChop is not online. PancakeChop
Joined: 14 May 2010
Total Posts: 3060
30 Jul 2014 11:47 AM
[ Content Deleted ]
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
30 Jul 2014 11:51 AM
There should be an example in my inventory called 'Datastore stats'. I would type it up now but I am on mobile.
Report Abuse
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
30 Jul 2014 11:58 AM
I have the script, does that save leaderstats?
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
30 Jul 2014 12:01 PM
Yeah
Report Abuse
Succulence is not online. Succulence
Joined: 24 Sep 2012
Total Posts: 1437
30 Jul 2014 12:03 PM
So this would save stars?
local store = game:GetService("DataStoreService"):GetOrderedDataStore("Wins")

game.Players.PlayerAdded:connect(function(player)

player:WaitForDataReady()
local pKey = "plr_"..player.Name

local ls = Instance.new("IntValue", player)
ls.Name = "leaderstats"

local tix, tokens = Instance.new("IntValue", ls), Instance.new("IntValue", ls)
tix.Name = "Stars"
tokens.Name = "Wins Tokens"

local mode = Instance.new("BoolValue", player)
mode.Name, mode.Value = "playing", true

local wins = Instance.new("IntValue", ls)
wins.Name = "Wins"
wins.Value = 0

tix.Value = 0
tokens.Value = 0

if store:GetAsync(pKey) ~= nil then
wins.Value = store:GetAsync(pKey)
else
wins.Value = 0
end

wins.Changed:connect(function(value)
store:SetAsync(pKey, value)
end)
end)



And, How do i clear a datastore?
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