How do I make a player have Stats if they are new too the game?
My game is a cross-server game and I am mainly focusing on Datastores. For new players, How would i go on adding Data to their values?
05 | print ( 'make sure to add jersey' ), |
17 | local DSS = game:GetService( "DataStoreService" ) |
19 | local datastore = DSS:GetDataStore( "YourChampion" ) |
22 | for index,value in pairs (_G.Data) do |
23 | datastore:UpdateAsync(index, function () return value end ) |
27 | function generateDataKey(player) |
28 | local ret = "Champion:" ..player.userId |
33 | function generateDataTable(player) |
35 | koins = player.PlayerGui.Nice.Data.koins.Value, |
36 | level = player.PlayerGui.Nice.Data.Level.Value, |
37 | xp = player.PlayerGui.Nice.Data.xp.Value, |
38 | rank = player.PlayerGui.Nice.Data.Rank.Value |