Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

DataStore Saved with 2 leaderstats but not with 4?

Asked by 6 years ago

I made a DataStore Service with 2 lstats (Leaderstats) and it worked, but I tried adding 2 more (4) and then it broke. Any ideas?

001local dataStores = game:GetService("DataStoreService")
002local ds1 = dataStores:GetDataStore("CashDataStore")
003local ds2 = dataStores:GetDataStore("LevelDataStore")
004local ds3 = dataStores:GetDataStore("RankDataStore")
005local ds4 = dataStores:GetDataStore("Total XP")
006local defaultCash = 0
007local playersLeft = 0
008local defaultLevel = 1
009local defaultRank = "InK"
010local DefaultXP = 0
011 
012 
013--[[
014    Ok So LStats Are
015    Cash
View all 138 lines...
0
Change line 5 to // local ds4 = dataStores:GetDataStore("Total_XP") \\ NiniBlackJackQc 1562 — 6y
0
You can save them all into one datastore. Using multiple at once will easily reach the per minute saving limit of datastores. Rheines 661 — 6y
0
So what do I do? LennyPlayzYT 269 — 6y

1 answer

Log in to vote
0
Answered by
stef0206 125
6 years ago
Edited 6 years ago

The problem is probally that you are setting the XP and Rank to a saved value, when there most likely is none, try this, might be something else

001local dataStores = game:GetService("DataStoreService")
002local ds1 = dataStores:GetDataStore("CashDataStore")
003local ds2 = dataStores:GetDataStore("LevelDataStore")
004local ds3 = dataStores:GetDataStore("RankDataStore")
005local ds4 = dataStores:GetDataStore("Total XP")
006local defaultCash = 0
007local playersLeft = 0
008local defaultLevel = 1
009local defaultRank = "InK"
010local DefaultXP = 0
011 
012 
013--[[
014    Ok So LStats Are
015    Cash
View all 138 lines...

Hopes this helps

Ad

Answer this question