Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When I have a lot of cash the cash resets. Can anybody help me?

When I have a lot of the stat "Cash" or any of the stats in the game it resets to 0. Can anybody help me?

3 comments

0

Please post your code

1

Please post full code to we can know your problems.

0

Ok.

2 answers

✓ Accepted answer

I know I don't have good explain for this but, when you add the value too much that make the value show like this 1.561717e+18, it will reset after you do anything to the value like plus, muiltpy, etc...

Hope this better explain on Discord, sorry if you don't get it.

local dataStore = game:GetService("DataStoreService"):GetDataStore("SavingAllOfThisStuff") local key = "user-"

game.Players.PlayerAdded:connect(function(p) local stats = Instance.new("Folder") stats.Name = "leaderstats" stats.Parent = p

local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 1 
cash.Parent = stats
	
local Multi = Instance.new("IntValue")
Multi.Name = "Multi"
Multi.Value = 1
Multi.Parent = stats
	
local Rebirths = Instance.new("IntValue")
Rebirths.Name = "Rebirths"
Rebirths.Value = 1
Rebirths.Parent = stats
	
local SuperRebirths = Instance.new("IntValue")
SuperRebirths.Name = "SuperRebirths"
SuperRebirths.Value = 1 
SuperRebirths.Parent = stats
	
local Power = Instance.new("IntValue")
Power.Name = "Power"
Power.Value = 1 
Power.Parent = stats
	
local SuperPower = Instance.new("IntValue")
SuperPower.Name = "SuperPower"
SuperPower.Value = 1 
SuperPower.Parent = stats
	
local Prestige = Instance.new("IntValue")
Prestige.Name = "Prestige"
Prestige.Value = 1
Prestige.Parent = stats
	
local UltraPrestige = Instance.new("IntValue")
UltraPrestige.Name = "UltraPrestige"
UltraPrestige.Value = 1
UltraPrestige.Parent = stats

local Life = Instance.new("IntValue")
Life.Name = "Life"
Life.Value = 1
Life.Parent = stats


local Sacrifice = Instance.new("IntValue")
Sacrifice.Name = "Sacrifice"
Sacrifice.Value = 1
Sacrifice.Parent = stats

pcall(function()
	local stats = dataStore:GetAsync(p.UserId)
	if stats then
		p.leaderstats.Cash.Value = stats.Cash
		p.leaderstats.Multi.Value = stats.Multi
		p.leaderstats.Rebirths.Value = stats.Rebirths
		p.leaderstats.SuperRebirths.Value = stats.SuperRebirths
		p.leaderstats.Power.Value = stats.Power
		p.leaderstats.SuperPower.Value = stats.SuperPower
		p.leaderstats.Prestige.Value = stats.Prestige
		p.leaderstats.UltraPrestige.Value = stats.UltraPrestige
		p.leaderstats.Life.Value = stats.Life
		p.leaderstats.Sacrifice.Value = stats.Sacrifice
		print("Loaded")
	end
end)

1 comment

0

@Block_manvn @filipalla

This discussion is preserved as it was. New answers, comments, and votes are closed.