for _,Panel in pairs(UI.Menu.ItemMenu:GetChildren()) do if Panel:IsA("GuiObject") then UI.Menu.Buy.MouseButton1Click:connect(function() if Panel.ItemSelect.Value == true and Player.StatData.Credits.Value >= TotalAmount.Value then Player.StatData.Credits.Value = Player.StatData.Credits.Value - TotalAmount.Value wait(0.1) ReplicatedStorage.Items[Panel.ItemName.Value]:Clone().Parent = Player.Backpack elseif Panel.ItemSelect.Value == true and Player.StatData.Credits.Value ~= TotalAmount.Value then Denied()--Just makes a messege pop up saying you do not having nuff mooneh end end) end end
Hello!
I am kinda stumped but basically I can buy the items but when the total amount is equal to or exact to what the player has in their "Wallet" so to speak, it will only clone the one item instead of both, even though I have enough Credits to purchase both the items.
?
Any ideas?