AzTecNat
|
  |
| Joined: 19 Aug 2016 |
| Total Posts: 22 |
|
|
| 26 Sep 2016 06:13 PM |
im trying to make a data system for fe. -- This is Simple Data Persistance for your game :D -- Just put this into the Workspace and you can save multiple scores in your game when -- players enter and leave :) -- WARNING: You need to have leaderstats with at least one stat to be saved in it -- or this script is pointless and won't work :) -- By: CloneTrooper1019 -- Feel free to erase all this green text. I don't care. -- Im just glad you are using my script :)
--------Don't edit below unless you know what your doing--------
function onPlayerEntered(player) wait(5)-- Give the game a moment to find the player instead of shooting instantly. player:WaitForDataReady() -- Gotta have this repeat wait(0.01) until player:FindFirstChild("leaderstats") -- waits for the stats. if player.DataReady then -- A little pointless But whatever :) if player:findFirstChild("leaderstats") then local score = player.leaderstats:GetChildren() -- Were going to find some scores. for i = 1,#score do local ScoreLoaded = player:LoadNumber("Halo"..score[i].Name.."") -- This looks for the score. wait() -- Wait for the score to load. if ScoreLoaded ~= 0 then score[i].Value = ScoreLoaded end end end end end
function onPlayerLeaving(player) -- We gotta fire this before the player leaves. if player:findFirstChild("leaderstats") then local score = player.leaderstats:children() -- Targeting the scores before the player is gone for i = 1,#score do player:SaveNumber("Halo"..score[i].Name.."", score[i].Value) -- Saving the score. end end end
game.Players.PlayerAdded:connect(onPlayerEntered) game.Players.PlayerRemoving:connect(onPlayerLeaving) print("Save system Has been Successfully loaded!")
Tastefullittlehamlet. |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 26 Sep 2016 06:15 PM |
Funny because its outdated
And a save system can be automatically fe compatible |
|
|
| Report Abuse |
|
|
AzTecNat
|
  |
| Joined: 19 Aug 2016 |
| Total Posts: 22 |
|
|
| 26 Sep 2016 06:16 PM |
Oh thanks mane
Tastefullittlehamlet. |
|
|
| Report Abuse |
|
|
Fangous
|
  |
| Joined: 03 Jul 2010 |
| Total Posts: 4448 |
|
|
| 26 Sep 2016 06:18 PM |
at first i thought you were asking a question then i realized you were actually just giving an answer then i realized the answer was from someone else
why is this even relevent |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 06:20 PM |
| why did you bother posting like 10 lines of comments? |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 06:38 PM |
this is probably copied and data persistence is bad anyway
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 06:51 PM |
what recurring said
𝒷𝓁𝑜𝒷𝒻𝒾𝓈𝒽 𝒶𝓇𝑒 𝑔𝑜𝒾𝓃𝑔 𝓉𝑜 𝒷𝑒 𝒷𝓇𝒾𝒸𝓀𝓈 𝒻𝑜𝓇 𝓂𝓎 𝓌𝒶𝓁𝓁; 𝓉𝒶𝓇𝒹𝒾𝑔𝓇𝒶𝒹𝑒𝓈 𝒶𝓇𝑒 𝑔𝑜𝒾𝓃𝑔 𝓉𝑜 𝒷𝑒 𝓉𝒽𝑒 𝑔𝓁𝓊𝑒 𝒻𝑜𝓇 𝓂𝓎 𝓌𝒶𝓁𝓁 |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 06:53 PM |
yeah what i said
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 06:54 PM |
yeah
𝒷𝓁𝑜𝒷𝒻𝒾𝓈𝒽 𝒶𝓇𝑒 𝑔𝑜𝒾𝓃𝑔 𝓉𝑜 𝒷𝑒 𝒷𝓇𝒾𝒸𝓀𝓈 𝒻𝑜𝓇 𝓂𝓎 𝓌𝒶𝓁𝓁; 𝓉𝒶𝓇𝒹𝒾𝑔𝓇𝒶𝒹𝑒𝓈 𝒶𝓇𝑒 𝑔𝑜𝒾𝓃𝑔 𝓉𝑜 𝒷𝑒 𝓉𝒽𝑒 𝑔𝓁𝓊𝑒 𝒻𝑜𝓇 𝓂𝓎 𝓌𝒶𝓁𝓁 |
|
|
| Report Abuse |
|
|
Aliics
|
  |
| Joined: 29 Sep 2014 |
| Total Posts: 471 |
|
|
| 26 Sep 2016 07:02 PM |
| isn't stuff like 'SaveNumber' deprecated because of DataStore? |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 07:03 PM |
yeah thats data persistence
𝒷𝓁𝑜𝒷𝒻𝒾𝓈𝒽 𝒶𝓇𝑒 𝑔𝑜𝒾𝓃𝑔 𝓉𝑜 𝒷𝑒 𝒷𝓇𝒾𝒸𝓀𝓈 𝒻𝑜𝓇 𝓂𝓎 𝓌𝒶𝓁𝓁; 𝓉𝒶𝓇𝒹𝒾𝑔𝓇𝒶𝒹𝑒𝓈 𝒶𝓇𝑒 𝑔𝑜𝒾𝓃𝑔 𝓉𝑜 𝒷𝑒 𝓉𝒽𝑒 𝑔𝓁𝓊𝑒 𝒻𝑜𝓇 𝓂𝓎 𝓌𝒶𝓁𝓁 |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2016 07:29 PM |
You can make comments on multiple lines by not doing -- every line, if you want:
--[[This is your comment. This is your comment too. This is also your comment. --]] print("Hello, world!") --This is NOT your comment. |
|
|
| Report Abuse |
|
|