Need help with the error attempt to perform arithmetic (add) on function and number

can anybody help me with this?

my script:

local multi = 0

local function multi(player)
    for i, v in pairs(player:WaitForChild("Pets"):GetChildren()) do
        multi = multi + v.Multiplier1.Value
    end
    return multi
end
2 Likes

Both multi the function and multi the variable have the same name :slight_smile: Hope this helps!

1 Like

A fixed version would be:

local multi = 0

local function getMulti(player)
    for i, v in pairs(player:WaitForChild("Pets"):GetChildren()) do
        multi = multi + v.Multiplier1.Value
    end
    return multi
end
2 Likes