Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] Sell Script not selling and there's no output error?!

My sell script isn't selling and It's all written correctly and the output isn't erroring so I'm confused.

function perks:Sell(plr)
	print("Sell activated!")
	
	local player = game.Players[plr]
	print(player)
	local pet = player.PetFolder.CurrentlyEquipped.Value
	
	local info = player.leaderstats.Information.Value
	local coins = player.leaderstats.Coins.Value
	
	local premium = player.ProductsFolder.Premium.Value
	local vip = player.ProductsFolder.VIP.Value
	local double = player.ProductsFolder.DoubleSell.Value
	
	if pet == "" then
		if premium == true and vip == true and double == true then
			coins += (info * 4)
			info -= info
		elseif premium == true and double == true then
			coins += (info * 2.5)
			info -= info
		elseif premium == true and vip == true then 
			coins += (info * 2)
			info -= info
		elseif premium == true then
			coins += (info * 0.5)
			info -= info
		elseif double == true and vip == true then
			coins += (info * 3.5)
			info -= info
		elseif double == true then
			coins += (info * 2)
			info -= info
		elseif vip == true then
			coins += (info * 1.5)
			info -= info
		else
			coins += (info)
			info -= info
		end
	else
		if premium == true and vip == true and double == true then
			coins += (info * 4) * perks[pet].coinMultiplier
			info -= info
		elseif premium == true and double == true then
			coins += (info * 2.5) * perks[pet].coinMultiplier
			info -= info
		elseif premium == true and vip == true then 
			coins += (info * 2) * perks[pet].coinMultiplier
			info -= info
		elseif premium == true then
			coins += (info * 0.5) * perks[pet].coinMultiplier
			info -= info
		elseif double == true and vip == true then
			coins += (info * 3.5) * perks[pet].coinMultiplier
			info -= info
		elseif double == true then
			coins += (info * 2) * perks[pet].coinMultiplier
			info -= info
		elseif vip == true then
			coins += (info * 1.5) * perks[pet].coinMultiplier
			info -= info
		else
			coins += (info) * perks[pet].coinMultiplier
			info -= info
		end
	end
end

1 answer

So the problem was that the when I was indexing stats I was just getting the value of it so it would just be a math equation and it wouldn't update the stat object.

This discussion is preserved as it was. New answers, comments, and votes are closed.