Attempt to perform arithmetic (add) on string and number

OHH! it’s the variable amount, try this instead:

swipeEvent.OnServerEvent:Connect(function(plr,name)
	if plr.ScytheDebounce.Value == false then
		plr.ScytheDebounce.Value = true
		local amount = sytheData[name]["Strength"].Value
		local double = 1
		if plr.Data.DoubleStrength.Value == true then
			double = 2
		end
		plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value + (((amount + getMultiplier(plr,"Multiplier1"))*((plr.leaderstats.Rebirths.Value/10)))*double)
		waitM.Wait(0.38)
		plr.ScytheDebounce.Value = false
	end
end)
1 Like

This can’t be the solution, since the error says string and number, it is actually in order meaning the first variable is the string and the second one is the number.

Apparently, that script doesn’t work, I’ll try the other one.

Dang, the error is still there. Can I hire you to fix the bug in studios?

Edit: nvm, I did not know that order matters.

Sorry I can’t be hired, but could you make sure you copy pasted the script that I sent? I did not change the line that’s causing the error, I changed another one

I copy and pasted it, but the script didn’t work.

try Multiplier1.Value if it’s a numbervalue then

1 Like

Could it be the function getMultiplier()? That could be returning a string.
Also, something important. What is leaderstats.Rebirths.Value???

It’s a leaderstat named “Rebirths”

leaderstat isnt a class haha. You know how Strength was an IntValue? What is rebirths? Is it an IntValue?

Rebirths is an IntValue too.

:thinking:

what is the getmultiplier function by the way?

That didn’t work, :thinking: :thinking:

show what the getmultiplier function looks like

local function getMultiplier(Player, multiplierName)
	local Multi = 0
	for i,v in pairs(Player.Pets:GetChildren()) do
		if v.Equipped.Value == true then
			Multi = Multi + v[multiplierName].Value
		end
	end
	return Multi
end

Its probably the function.
THIS LINE:

Multi = Multi + v[multiplierName].Value

What are the values in Player.Pets?
Are they also IntValues? StringValues?
If they are string values, thats the issue.

I know that the Player.Pets folder is created in game, so the values are also created in game. What kind of values are created?

1 Like

Player.Pets is a folder, I’m pretty sure.

I know its a folder, but what about the items inside of it? Are they StringValues? IntValues?

There’s lots inside of it, mostly folders and models.