local player = game.Players.LocalPlayer
local s = require(game.ReplicatedStorage:WaitForChild("ModuleScript"))
while wait() do
script.Parent.Text = s.Shorter(player.leaderstats.Strength.Value).." / "..s.Shorter(player.leaderstats.Capacity.Value)
end
local Number = {}
Number.Shorter = function(IN)
if IN < 1e6 and IN >= 1e3 then
IN = (IN/1e3).."K"
elseif IN < 1e9 and IN >= 1e6 then
IN = (IN/1e6).."M"
elseif IN < 1e12 and IN >= 1e9 then
IN = (IN/1e9).."B"
elseif IN < 1e15 and IN >= 1e12 then
IN = (IN/1e12).."t"
elseif IN < 1e18 and IN >= 1e15 then
IN = (IN/1e15).."q"
elseif IN < 1e21 and IN >= 1e18 then
IN = (IN/1e18).."Q"
elseif IN < 1e24 and IN >= 1e21 then
IN = (IN/1e21).."s"
elseif IN < 1e27 and IN >= 1e624 then
IN = (IN/1e24).."S"
elseif IN < 1e30 and IN >= 1e27 then
IN = (IN/1e27).."o"
elseif IN < 1e33 and IN >= 1e30 then
IN = (IN/1e30).."d"
elseif IN < 1e36 and IN >= 1e33 then
IN = (IN/133).."U"
elseif IN < 1e39 and IN >= 1e36 then
IN = (IN/1e36).."D"
elseif IN < 1e42 and IN >= 1e39 then
IN = (IN/1e39).."T"
elseif IN < 1e45 and IN >= 1e42 then
IN = (IN/1e42).."Qd"
elseif IN < 1e48 and IN >= 1e45 then
IN = (IN/1e45).."Qc"
elseif IN < 1e51 and IN >= 1e48 then
IN = (IN/1e48).."Sd"
elseif IN < 1e54 and IN >= 1e51 then
IN = (IN/1e51).."St"
elseif IN < 1e57 and IN >= 1e54 then
IN = (IN/1e54).."O"
elseif IN < 1e60 and IN >= 1e57 then
IN = (IN/1e57).."N"
elseif IN < 1e63 and IN >= 1e60 then
IN = (IN/1e60).."V"
end
return IN
end
return Number
Ok so, I have had a play around with this code, and I changed this part:
if success then
print("Data Loaded")
Strength.Value = data.S
Capacity.Value = data.C
Rank.Value = data.R
Diamonds.Value = data.D
Coins.Value = data.Cs
MaxJumps.Value = data.M
Need.Value = data.N
else
print("Error")
warn(msg)
end
to
if data then
print("Data Loaded")
Strength.Value = data.S
Capacity.Value = data.C
Rank.Value = data.R
Diamonds.Value = data.D
Coins.Value = data.Cs
MaxJumps.Value = data.M
Need.Value = data.N
else
print("Error")
warn(msg)
end
so it checks to see if there is any data there instead of checking if the pcall is true or false. I am not sure why, but it was reading as true, so the script was erroing when it was trying to change the leaderstats values with no data in it. For this to work, I also was not able to use the studio gameplay, only the actual game.
Do you have a datastore editor? If not, the one I use is: DataStore Editor - Roblox it is 150 robux though, however you can probably find another one somewhere. You can get something like this and edit your datastores in studio.