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

Why doesn't it save, all leaderstats saves except this one?

Asked by
kapipi12 133
6 years ago

No idea what's wrong with the fishvalue, I want it other leaderstat but not in leaderstats, I want it like hidden leaderstat which helps script but to not make it visible on leaderstats.. Here is my script

01local DataStoreService = game:GetService("DataStoreService")
02local CashDS = DataStoreService:GetDataStore("CashDS-")
03local IbDS = DataStoreService:GetDataStore("IbDS-")
04local CatchesDS = DataStoreService:GetDataStore("CatchesDS-")
05local FishValueDS = DataStoreService:GetDataStore("FishValueDS-")
06 
07game.Players.PlayerAdded:Connect(function(plr)
08    local stats = Instance.new("IntValue",plr)
09    stats.Name = "leaderstats"
10    local cash = Instance.new("IntValue",stats)
11    cash.Name = "Cash"
12    local ib = Instance.new("IntValue",stats)
13    ib.Name = "InBucket"
14    local xp = Instance.new("IntValue",stats)
15    xp.Name = "Catches"
View all 44 lines...
0
Why are you using individual data stores for each value. You can use one giant data store and save a table instead User#24403 69 — 6y
0
I have changed it to one but that doesnt matter kapipi12 133 — 6y

1 answer

Log in to vote
5
Answered by
arshad145 392 Moderation Voter
6 years ago

Hello,

Please accept this answer.

01local DataStoreService = game:GetService("DataStoreService")
02local DS = DataStoreService:GetDataStore("Single_DS")
03 
04game.Players.PlayerAdded:Connect(function(plr)
05    local key = tostring(plr.UserId)
06    local stats = Instance.new("IntValue") -- Avoid using one line instance parenting.
07    local cash = Instance.new("IntValue")
08    local ib = Instance.new("IntValue")
09    local xp = Instance.new("IntValue")
10    local fv = Instance.new("IntValue")
11 
12    stats.Name = "leaderstats"
13    cash.Name = "Cash"
14    ib.Name = "InBucket"
15    xp.Name = "Catches"
View all 62 lines...
1
This was resolved on discord server. arshad145 392 — 6y
Ad

Answer this question