Error: attempt to call a number value

It gives an error that is written in the title of this topic, I don’t know why, but all currencies are present in the player. I am attaching the server and local script below:

game.Players.PlayerAdded:Connect(function(plr)
	local db = ds:GetAsync(plr.UserId .. "_jobs")
	if not db then
		db = {
			["LevelLoader"] = 1,
			["XPLoader"] = 0,
		}
	end
	old[plr.Name] = db["xpLoader"]
	
	local jobs = Instance.new("Folder")
	jobs.Name = "JobsData"
	jobs.Parent = plr
	
	local lvlLoader = Instance.new("IntValue", jobs)
	lvlLoader.Name = "lvlLoader"
	lvlLoader.Value = db["LevelLoader"]
	
	local xpLoader = Instance.new("IntValue", lvlLoader)
	xpLoader.Name = "xpLoader"
	xpLoader.Value = db["XPLoader"]
	
	local olM = ol(lvlLoader.Value)
	
	xpLoader.Changed:Connect(function()
		if xpLoader.Value>=ol(lvlLoader.Value) 
--local script
local ol = (function(level) return level*100+20 end)
local lvlf = plr:WaitForChild("JobsData"):FindFirstChild("lvlLoader")
local old = lvlf.xpLoader.Value
statsJob.LevelFrame.Label.Text = "Lvl: "..lvlf.Value.." | "..lvlf.xpLoader.Value.."/"..ol(lvlf.Value)" EXP"

local function levelConfig()
	lvlf.xpLoader.Changed:Connect(function()
		local lvl = game.Players.LocalPlayer:WaitForChild("JobsData"):FindFirstChild("lvlLoader")
		if lvl.xpLoader.Value <=0 then
			old = 
end

As the error says, you are calling (or executing) a number as a function. Read your errors and follow the traceback to see exactly where the line errors.

Error in local script in variable “lvlf” at the very beginning

Can you please send a screenshot of the error?


This error appears.

Neither of the scripts provided have something that could generate that error at line 11.

Can you please either send the actual script that is erroring, or send more of the script such that it is clear what line 11 is.

Ah, i see the error:
image

You are missing .. between the function and the string.

So it should be

ol(levelf.Value) .. " EXP"

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