How do i fix "attempt to perform arithmetic (mul) on Instance and number"

So im making a level system but im not sure what this means, can someone help me?


Heres the script

local bar = script.Parent.BackFrame.Expbar
local text = script.Parent.TextLabel

local player = game.Players.LocalPlayer
local level = player.leaderstats.Level
local exp = player.leaderstats.Exp
local expNeeded = tonumber(100 + math.exp(level * 2))^level.Value

text.Text = exp.Value.."/"..expNeeded

local change = exp.Value / expNeeded
bar:TweenSize(UDim2.new(change,0,1,0),"In","Linear",0.5)

exp.Changed:Connect(function()
	expNeeded = tonumber(100 + math.exp(level * 2))^level.Value
	text.Text = exp.Value.."/"..expNeeded
	
	local change = exp.Value / expNeeded
	bar:TweenSize(UDim2.new(change,0,1,0), "In","Linear",0.5)
end)

level.Changed:Connect(function()
	expNeeded = tonumber(100 + math.exp(level * 2))^level.Value
	text.Text = exp.Value.."/"..expNeeded

	local change = exp.Value / expNeeded
	bar:TweenSize(UDim2.new(change,0,1,0), "In","Linear",0.5)
end)

level is the object. You just forgot a .Value :slight_smile:

You can use exp as a variable. math.exp is the ROBLOX version :slight_smile:

Thanks it works