|
| 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 |
|
|
| |
|
| |
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 30 Jul 2014 11:58 AM |
| I have the script, does that save leaderstats? |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|