01 | local DSService = game:GetService( "DataStoreService" ):GetDataStore( "Currency" ) |
02 | local Saving = 0 |
03 |
04 | game:BindToClose( function () |
05 | repeat wait() until Saving < = 0 |
06 | end ) |
07 |
08 | game:GetService( "Players" ).PlayerAdded:connect( function (plr) |
09 | local leader = Instance.new( "Folder" ,plr) |
10 | leader.Name = "leaderstats" |
11 |
12 | local Credits = Instance.new( "IntValue" ,leader) |
13 | Credits.Name = "Credits" |
14 |
15 | local Diamonds = Instance.new( "IntValue" ,leader) |
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?
Try using pcall
. Also please do not use Instance.new
with parent parameter, it's deprecated. Same with connect
, use Connect
instead.