Attempt to perform arithmetic (mul) on number and Instance [ERROR]

Hi! I don’t know how this error is possible, because i don’t multiply anything here?

	local click = game.ReplicatedStorage.Events.Click:InvokeServer(script.Parent.Increment.Value)

This is the full script:

script.Parent.Activated:Connect(function()
local plr = game.Players.LocalPlayer
local gui = plr.PlayerGui
local click = game.ReplicatedStorage.Events.Click:InvokeServer(script.Parent.Increment.Value)
end)

local function DescribeIncrease(increasement)
print(increasement)
end

game.ReplicatedStorage.Events.Click.OnClientInvoke = DescribeIncrease()

local click = game.ReplicatedStorage.Events.Click:InvokeServer(script.Parent.Increment.Value)

What are you trying to do here? Can we see the server code where the server gets invoked?

local function GivePoints(plr, increment)
local rebirthvalue = plr.RebirthValue
local clickvalue = increment * rebirthvalue

plr.leaderstats.RoCoin.Value += clickvalue

game.ReplicatedStorage.Events.Click:InvokeClient(plr, clickvalue)

end

game.ReplicatedStorage.Events.Click.OnServerInvoke = GivePoints

What kind of Instance is increment and rebirthvalue? If RebirthValue is an IntValue or NumberValue, then you need to change it to

local rebirthvalue = plr.RebirthValue.Value
2 Likes

Alright, but why does it give the error when sending a NumberValue’s (or any value object) value?