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)
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
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