Why doesn't it save, all leaderstats saves except this one?
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
01 | local DataStoreService = game:GetService( "DataStoreService" ) |
02 | local CashDS = DataStoreService:GetDataStore( "CashDS-" ) |
03 | local IbDS = DataStoreService:GetDataStore( "IbDS-" ) |
04 | local CatchesDS = DataStoreService:GetDataStore( "CatchesDS-" ) |
05 | local FishValueDS = DataStoreService:GetDataStore( "FishValueDS-" ) |
07 | game.Players.PlayerAdded:Connect( function (plr) |
08 | local stats = Instance.new( "IntValue" ,plr) |
09 | stats.Name = "leaderstats" |
10 | local cash = Instance.new( "IntValue" ,stats) |
12 | local ib = Instance.new( "IntValue" ,stats) |
14 | local xp = Instance.new( "IntValue" ,stats) |
16 | local fv = Instance.new( "IntValue" ,plr) |
19 | cash.Value = CashDS:GetAsync( tostring (plr.userId)) or 0 |
20 | ib.Value = IbDS:GetAsync( tostring (plr.userId)) or 0 |
21 | xp.Value = CatchesDS:GetAsync( tostring (plr.userId)) or 0 |
22 | fv.Value = FishValueDS:GetAsync( tostring (plr.userId)) or 0 |
24 | CashDS:SetAsync( tostring (plr.userId),cash.Value) |
25 | IbDS:SetAsync( tostring (plr.userId), ib.Value) |
26 | CatchesDS:SetAsync( tostring (plr.userId), xp.Value) |
27 | FishValueDS:SetAsync( tostring (plr.userId),fv.Value) |
29 | cash.Changed:connect( function () |
30 | CashDS:SetAsync( tostring (plr.userId), cash.Value) |
33 | ib.Changed:connect( function () |
34 | IbDS:SetAsync( tostring (plr.userId), ib.Value) |
37 | xp.Changed:connect( function () |
38 | CatchesDS:SetAsync( tostring (plr.userId), xp.Value) |
41 | fv.Changed:connect( function () |
42 | FishValueDS:SetAsync( tostring (plr.userId), fv.Value) |