I can't fix the script

help me fix the script I know how to solve I have classes in string value in leaderstats and I don’t want to change it to a number value help me fix here is the script

local MarketPlaceService = game:GetService("MarketplaceService")
local id = 251630884

local cooldown = 3
local ToolName = 'Punch'

local function boost(strength, strengthAdd, player: Player, multipliers)
	while task.wait(cooldown) do
		local n = multipliers[1].Value
		local owns = MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 257905319)

		for i,v in multipliers do
			if i == 1 then continue end
			n *= v.Value
		end

		if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 257904902) then
			n *= 2    
		end

		if player.Character and player.Character:FindFirstChild(ToolName) then
			strength.Value += if owns then n*2 else n
		end
	end
end

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(player, ido, purchased)
	if purchased and id == ido then
		local multipliers = {
			player:WaitForChild("ZoneMulti"),
			player.leaderstats.Class.Value,
			player.BestFusion.FusionMulti.Value
		}
		print(multipliers)
		local strength = player:WaitForChild("Strength")
		local strengthAdd = player:WaitForChild("Multi")

		boost(strength, strengthAdd, player, multipliers)
	end
end)

game.Players.PlayerAdded:Connect(function(player)
	local multipliers = {
		player:WaitForChild("ZoneMulti"),
		player.leaderstats.Class,
		player.BestFusion.FusionMulti
	}
	local strength = player:WaitForChild("Strength")
	local strengthAdd = player:WaitForChild("Multi")

	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, id) then
		boost(strength, strengthAdd, player, multipliers)
	end
end)

error ServerScriptService.AutoClicker:14: attempt to perform arithmetic (mul) on number and string - Server - AutoClicker:14

You sure that you made the value a ‘NumberValue’ and not a ‘StringValue’?
If that is a number use tonumber(v.Value)

The class is a string value and everything else is a multiplexer that it is all a number value

This was where the error was.

TEXT OCCUPIER BECAUSE THERE WAS NOT ENOUGH TEXT TO SEND THIS MESSAGE.

Should be like this:

for i,v in multipliers do
	if i == 1 then continue end
	if typeof(v.Value) ~= "number" then continue end
	
	n *= v.Value
end

It didn’t help, now I don’t get a multiplier from classes

Thats because its only multiplying with the FusionMulti. You skip the first index then you the code skips the 2nd one because it’s not a number then we’re left with only 1 value to multiply with

And you can’t fix it, I want to get another multiplier from the classes

We did it yesterday, remember? Maybe we can do it according to the scheme we did yesterday.

What you said to change the name there to what you said, I did.

To:

local function boost(strength, strengthAdd, player: Player, multipliers)
	local mults = require(game.ServerStorage["classMults"])
	
	while task.wait(cooldown) do
		local n = multipliers[1].Value * mults[multipliers[2].Value] * multipliers[3].Value
		
		local owns = MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 257905319)

		if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 257904902) then
			n *= 2    
		end

		if player.Character and player.Character:FindFirstChild(ToolName) then
			strength.Value += if owns then n*2 else n
		end
	end
end

You can’t multiply with a ‘class’
What you’re doing is number x string,
which in sense of mathematics, doesn’t make sense.

Now I don’t get anything from the multiplier

Can you print your multipliers and tell me what they’re? You can add the print here:

local multipliers = {
		player:WaitForChild("ZoneMulti"),
		player.leaderstats.Class,
		player.BestFusion.FusionMulti
	}

print(multipliers)

By multiplier I mean Multi It doesn’t work for me

I was talking about this multiplier.

What do you mean by “doesnt work for me”?

I get 128 forces from the tool, let’s say, and I get 16 from this script, that is, he sees only classes, he doesn’t even see gamepasses

it’s still relevant help solve the problem