Very oofed im trying to make a gui that shows your cash but i cant seem to do it. my script:
local suffixes = {'','K+','M+','B+','T+','Qd+','Qn+','S+','Sp+','O+','N+','D+'} local function format(val) for i=1, #suffixes do if tonumber(val) < 10^(i*3) then return math.floor(val/((10^((i-1)*3))/100))/(100)..suffixes[i] end end end local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() local leaderboard = player:WaitForChild("leaderstats") local Stats = leaderboard.Coins local value = script.Parent script.Parent.Text = format(Stats.Value)script.Parent.Parent.Parent.ValName.Text = "Cash" Stats:GetPropertyChangedSignal("Value"):Connect(function() script.Parent.Text = format(Stats.Value) end)
i suspect its the suffixes that is bugged
Add a GUI and put this LocalScript inside of the TextLabel
wait(1); local u1 = { "", "K", "M", "B", "T", "Qd", "Qn", "Sx", "Sp", "Oc", "N", "De", "UDe", "DDe", "TDe", "QdDe", "QnDe", "SxDe", "SpDe", "OcDe", "NvDe", "Vgn", "UVg", "DVg", "TVg", "qtV", "QnV", "SeV", "SPG", "OVG", "NVG", "TGN", "UTG", "DTG", "tsTG", "qtTG", "QnTG", "ssTG", "SpTG", "OcTG", "NoAG", "UnAG", "DuAG", "TeAG", "QdAG", "QnAG", "SxAG", "SpAG", "OcAG", "NvAG", "CT" }; local function v1(p1) for v2 = 1, #u1 do if tonumber(p1) < 10 ^ (v2 * 3) then return math.floor(p1 / (10 ^ ((v2 - 1) * 3) / 100)) / 100 .. u1[v2]; end; end; end; local l__LocalPlayer__3 = game.Players.LocalPlayer; while wait(0.01) do script.Parent.Text = v1(l__LocalPlayer__3:WaitForChild("leaderstats"):WaitForChild("Cash").Value); end;
Well if you're just trying to make a UI that shows the value "Cash" here's how to do it.
LEADERSTAT SCRIPT:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder",player) leaderstats.Name = "leaderstats" leaderstats.Parent = player local cash = Instance.new("IntValue", leaderstats) cash.Name = "Cash" cash.Value = 10 ---- Change value if you want
=========================================================================
-- Insert Gui in StarterGui and add a textlabel. -- Move textlabel anywhere and then edit it how you like. -- Add a localscript in the textlabel and copy and paste the lines of code below into the script while wait()do local player = game.Players.LocalPlayer script.Parent.Text = "Cash: "..player:WaitForChild("leaderstats"):FindFirstChild("Cash").Value end