****Very oofed im trying to make a gui that shows your cash but i cant seem to do it. my script:
01 | local suffixes = { '' , 'K+' , 'M+' , 'B+' , 'T+' , 'Qd+' , 'Qn+' , 'S+' , 'Sp+' , 'O+' , 'N+' , 'D+' , 'U+' , 'Dd+' , 'Td+' , 'Qd+' , 'Qnd+' , 'Sd+' , 'Spd+' , 'Od+' , 'Nd+' , 'Vg+' , 'Ug+' , 'Dg+' , 'Tv+' , 'Qt+' , 'Qv+' , 'Sv+' , 'Sg+' , 'Ov+' , 'Ng+' , 'Tg+' , 'Ut+' , 'Dt+' , 'Tt+' , 'Qg+' , 'Qtg+' , 'Sg+' , 'Spt+' , 'Otg+' , 'Nag+' , 'Ung+' , 'Dug+' , 'Teg+' , 'Qa+' , 'Qn+' , 'Sag+' , 'Spa+' , 'Oa+' , 'Nv+' , 'Ct+' } |
02 | local function format(val) |
03 | for i = 1 , #suffixes do |
04 | if tonumber (val) < 10 ^(i* 3 ) then |
05 | return math.floor(val/(( 10 ^((i- 1 )* 3 ))/ 100 ))/( 100 )..suffixes [ i ] |
06 | end |
07 | end |
08 | end |
09 |
10 |
11 | local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() |
12 | local leaderboard = player:WaitForChild( "leaderstats" ) |
13 | local Stats = leaderboard.Coins |
14 | local value = script.Parent |
15 |
16 | script.Parent.Text = format(Stats.Value)script.Parent.Parent.Parent.ValName.Text = "Cash" |
17 |
18 | Stats:GetPropertyChangedSignal( "Value" ):Connect( function () |
19 | script.Parent.Text = format(Stats.Value) |
20 | end ) |
it doesnt work idk why