Sir_Spaceboi

Untitled

Apr 20th, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.36 KB | None | 0 0
  1. local orderingSystem = {}
  2.  
  3. local itemsInOrder = 0
  4. local totalOrderPrice = 0
  5.  
  6. local items = {}
  7. local itemsExtra = {}
  8.  
  9. local Blur1 = script.Parent.OrderingSystem.BlurThing1
  10. local toppingsFrame = script.Parent.OrderingSystem.toppingsFrame
  11. local sizeFrame = script.Parent.OrderingSystem.sizeFrame
  12. local signInFrame = script.Parent.OrderingSystem.signInFrame
  13. local customerWaitFrame = script.Parent.OrderingSystem.customerWaitFrame
  14. local itemHolderFrame = script.Parent.OrderingSystem.OrderList
  15.  
  16. local Info = TweenInfo.new(7, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
  17. local Info2 = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
  18. local Info3 = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
  19.  
  20. local HideWaitParam = {Position = UDim2.new(0.35, 0,1, 0)}
  21.  
  22. function getItemsInOrder()
  23.     for Index, Item in ipairs(itemHolderFrame:GetChildren()) do
  24.         if Item:IsA("Frame") and Item.Visible == true then
  25.             table.insert(items, Item.ItemNameLabel.Text)
  26.             print(Item .. " is item " .. Index .. " and is a " .. Item.ItemNameLabel.Text)
  27.         end
  28.     end
  29. end
  30.  
  31. function orderingSystem.customerFinishedOrder(Player, Price)
  32.     customerWaitFrame:TweenPosition(UDim2.new(0.35, 0,1, 0),nil, nil, 2)
  33.     local CreateShowTween = TweenService:Create(Blur1, Info, ShowTweenPrm)
  34.     CreateShowTween:Play()
  35.    
  36.     local CreateHideTween = TweenService:Create(customerWaitFrame, Info3, HideWaitParam)
  37.  
  38.     local CashierName = script.Parent.Parent.Parent.Cashier.Value
  39.  
  40.     script.Parent.Parent.Parent.Reader.Prompt.ProximityPrompt.Enabled = false
  41.     game.Players[Player.Name].leaderstats.Coins.Value = game.Players[Player.Name].leaderstats.Coins.Value - totalOrderPrice
  42.  
  43.     ------------------------
  44.  
  45.     customerWaitFrame.Body.Text = "Transaction Approved!"
  46.     wait(1.2)
  47.     customerWaitFrame.Body.Text = "Transaction Approved!"
  48.     wait(.7)
  49.     CreateHideTween:Play()
  50.  
  51.     game.Players[CashierName].PlayerGui.OrderingSummary.Summary:TweenPosition(UDim2.new(0.885, 0,0.045, 0), nil, nil, 2)
  52.     game.Players[CashierName].PlayerGui.OrderingSummary.Summary.UserOrder.Text = Player.Name .. "'s Order"
  53.  
  54.     for i,v in pairs(script.Parent.OrderingSystem.OrderList:GetChildren()) do
  55.         if v:IsA("Frame") then
  56.             v:Destroy()
  57.             itemsInOrder = 0
  58.             totalOrderPrice = 0
  59.             script.Parent.OrderingSystem.SendButton.Text = "Charge Customer $0"
  60.         end
  61.     end
  62.     getItemsInOrder()
  63. end
  64.  
  65. return orderingSystem
Advertisement
Add Comment
Please, Sign In to add comment