Abbreviations doesn't work!

Hello! I followed a tutorial on abbreviations so I copied from it and dissect it so i could learn. However, I tried to implement it to my system but it displays an error. I need help!

Error

989 Players.Cxdious.PlayerScripts.UpdateMoneyText:18: attempt to get length of a function value - Client - UpdateMoneyText:18
21:04:58.989 Script ‘Players.Cxdious.PlayerScripts.UpdateMoneyText’, Line 18 - function Abbreviations - Studio - UpdateMoneyText:18
21:04:58.990 Script ‘Players.Cxdious.PlayerScripts.UpdateMoneyText’, Line 41 - Studio - UpdateMoneyText:41

Script

local plr = game.Players.LocalPlayer

wait(1)

local Abbreviations = {
	"",
	"K",
	"M",
	"B",
	"T",
	"Q"
	
}

print("FOUNDED")

local function Abbreviations(Number)
	for i=1, #Abbreviations do
		if Number < 10 ^ (i * 3) then
			if Abbreviations[i] == "∞" then
				return "∞"
			else
				return math.floor(Number / ((10 ^ ((i-1) * 3)) / 100)) / (100) .. Abbreviations
			end
			
			elseif tostring(Number) == "inf" then
			
			return "∞"

		end
		
	end
	
end

while true do
	for i, v in pairs(workspace:WaitForChild("Money"):GetChildren()) do
		if v:IsA("Part") then
			local UpdateMoney = v.Money.Value * plr:WaitForChild("MoneyConfig").MoneyMP.Value

			v.BillboardGui.TextLabel.Text = "💸 +"..tostring(Abbreviations(math.round(v.Money.Value + UpdateMoney))).." Money"
	
		end
		
	end
	
wait(3)

	
end

both your function and your table are named Abbreviations try changing one of their names

local function get_abbreviation(Number)
    -- etc...
end

while true do
	for i, v in pairs(workspace:WaitForChild("Money"):GetChildren()) do
		if v:IsA("Part") then
			local UpdateMoney = v.Money.Value * plr:WaitForChild("MoneyConfig").MoneyMP.Value

			v.BillboardGui.TextLabel.Text = "💸 +"..tostring(get_abbreviation(math.round(v.Money.Value + UpdateMoney))).." Money"
		end
	end
	task.wait(3)
end
1 Like

Oh, no wonder! I’ll change it right now!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.