Sell script not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

A selling script that actually works!

  1. What is the issue?

The issue is everytime I got to sell it works and it puts the strength value to 0 but when I click I am supposed to get like +1 but is is going back to the same number that I sold, how can I fix this?

  1. What solutions have you tried so far?

Finding a solution!

local debounce = false

function getMultiplier(Player, multiplierName)
	local Multi = 1
	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

local id = 24229395

local sell = game.Workspace.SellingParts.SellingPart1

local player = game.Players.LocalPlayer

local sound = sell.CoinSound

sell.Touched:Connect(function()
	if debounce == false then
		local leaderstats = player:WaitForChild("leaderstats")
		local currency = leaderstats.Coins
		local selling = leaderstats.Strength

		if selling.Value > 0 then
			debounce = true
			sound:Play()
			wait(0.1)
			if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) then
				currency.Value = currency.Value + selling.Value * getMultiplier(player, "Multiplier1") * player.RankMultiplier.Value * 1
				selling.Value = 0
				player.Level.Exp.Value = player.Level.Exp.Value + 1
				debounce = false
			else
				currency.Value = currency.Value + selling.Value * getMultiplier(player, "Multiplier1") * player.RankMultiplier.Value
				selling.Value = 0
				player.Level.Exp.Value = player.Level.Exp.Value + 1
				debounce = false
			end
		end
	end

end)

Thank you in advance!

maybe do +1 since doing * is multiply and multiply by 1 do nothing

Anything multiplied by 1 will be the same number as it was. So you would want multiplied by 2 if that’s what you wanted

If that’s now what you wanted, replace it with

+ 1

It is okay it has been fixed it was in a local script!