Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local orderingSystem = {}
- local itemsInOrder = 0
- local totalOrderPrice = 0
- local items = {}
- local itemsExtra = {}
- local Blur1 = script.Parent.OrderingSystem.BlurThing1
- local toppingsFrame = script.Parent.OrderingSystem.toppingsFrame
- local sizeFrame = script.Parent.OrderingSystem.sizeFrame
- local signInFrame = script.Parent.OrderingSystem.signInFrame
- local customerWaitFrame = script.Parent.OrderingSystem.customerWaitFrame
- local itemHolderFrame = script.Parent.OrderingSystem.OrderList
- local Info = TweenInfo.new(7, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
- local Info2 = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
- local Info3 = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
- local HideWaitParam = {Position = UDim2.new(0.35, 0,1, 0)}
- function getItemsInOrder()
- for Index, Item in ipairs(itemHolderFrame:GetChildren()) do
- if Item:IsA("Frame") and Item.Visible == true then
- table.insert(items, Item.ItemNameLabel.Text)
- print(Item .. " is item " .. Index .. " and is a " .. Item.ItemNameLabel.Text)
- end
- end
- end
- function orderingSystem.customerFinishedOrder(Player, Price)
- customerWaitFrame:TweenPosition(UDim2.new(0.35, 0,1, 0),nil, nil, 2)
- local CreateShowTween = TweenService:Create(Blur1, Info, ShowTweenPrm)
- CreateShowTween:Play()
- local CreateHideTween = TweenService:Create(customerWaitFrame, Info3, HideWaitParam)
- local CashierName = script.Parent.Parent.Parent.Cashier.Value
- script.Parent.Parent.Parent.Reader.Prompt.ProximityPrompt.Enabled = false
- game.Players[Player.Name].leaderstats.Coins.Value = game.Players[Player.Name].leaderstats.Coins.Value - totalOrderPrice
- ------------------------
- customerWaitFrame.Body.Text = "Transaction Approved!"
- wait(1.2)
- customerWaitFrame.Body.Text = "Transaction Approved!"
- wait(.7)
- CreateHideTween:Play()
- game.Players[CashierName].PlayerGui.OrderingSummary.Summary:TweenPosition(UDim2.new(0.885, 0,0.045, 0), nil, nil, 2)
- game.Players[CashierName].PlayerGui.OrderingSummary.Summary.UserOrder.Text = Player.Name .. "'s Order"
- for i,v in pairs(script.Parent.OrderingSystem.OrderList:GetChildren()) do
- if v:IsA("Frame") then
- v:Destroy()
- itemsInOrder = 0
- totalOrderPrice = 0
- script.Parent.OrderingSystem.SendButton.Text = "Charge Customer $0"
- end
- end
- getItemsInOrder()
- end
- return orderingSystem
Advertisement
Add Comment
Please, Sign In to add comment