for some reason this always runs the elseif unless i have 0 ore. can anyone see my problem?
wait(0.1)
function sellclick()
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent
local item = plr.leaderboard.Ore
local money = plr.leaderboard.Money
local char = game.Workspace:FindFirstChild(plr.Name)
if item.Value >= script.Parent.Amount.Value then
item.Value = item.Value - script.Parent.Amount.Value
money.MoneyAdd.Value = money.MoneyAdd.Value + script.Parent.Total.Value
script.Parent.Parent.Parent.Approved.Visible = true
wait(1.5)
char.ShopTing.Value = 0
script.Parent.Parent.Parent.Parent:Destroy()
else if item.Value < script.Parent.Amount.Value then
script.Parent.Parent.Parent.Denied.Visible = true
wait(1.5)
char.ShopTing.Value = 0
script.Parent.Parent.Parent.Parent:Destroy()
end
end
end
script.Parent.Sell.MouseButton1Click:Connect(sellclick)

1 comment
Thank you! I was not using a local script, but I found another place where I was using one, which fixed it completely!