Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local orderingSystem = {}
- local itemsInOrder = 0
- local totalOrderPrice = 0
- 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 Info = TweenInfo.new(7, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
- local Info2 = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
- local ShowTweenPrm = {BackgroundTransparency = 1}
- local HideTweenPrm = {BackgroundTransparency = 0.25}
- local HideToppingsParam = {Position = UDim2.new(0.35, 0,1, 0)}
- local SignInFrameParam = {Position = UDim2.new(0.35, 0,1, 0)}
- local TweenService = game:GetService("TweenService")
- function orderingSystem.removeItem()
- itemsInOrder = itemsInOrder - 1
- end
- function orderingSystem.openRegister(Player, RegNum)
- local Prompt = script.Parent.Parent.Parent.Prompt.ProximityPrompt
- Prompt.Enabled = false
- wait(.7)
- local CreateSignInTween = TweenService:Create(signInFrame, Info2, SignInFrameParam)
- CreateSignInTween:Play()
- wait(.6)
- local CreateShowTween = TweenService:Create(Blur1, Info, ShowTweenPrm)
- CreateShowTween:Play()
- game.ReplicatedStorage.OrderingSystemZoom:FireClient(Player, RegNum)
- end
- function orderingSystem.categoryClicked(item)
- if item.Value == "iceCream" then
- script.Parent.OrderingSystem.smoothieItems:TweenPosition(UDim2.new(0, 0,1, 0), nil, nil, 1.5)
- script.Parent.OrderingSystem.iceCreamItems:TweenPosition(UDim2.new(0, 0,0.03, 0), nil, nil, 1.5)
- end
- if item.Value == "smoothie" then
- script.Parent.OrderingSystem.iceCreamItems:TweenPosition(UDim2.new(0, 0,1, 0), nil, nil, 1.5)
- script.Parent.OrderingSystem.smoothieItems:TweenPosition(UDim2.new(0, 0,0.03, 0), nil, nil, 1.5)
- end
- end
- function orderingSystem.addItem(itemName, price, itemType, extra, from)
- if itemsInOrder ~= 3 and game.Players[script.Parent.Parent.Parent.Cashier.Value].IsMakingOrder.Value == false then
- game.Players[script.Parent.Parent.Parent.Cashier.Value].IsMakingOrder.Value = true
- print(from)
- if itemType == "ICE CREAM" then
- if from ~= "toppings" then
- print(extra)
- local itemClone = script.Parent.sampleItem:Clone()
- itemClone.Parent = script.Parent.OrderingSystem.OrderList
- itemClone.Name = itemsInOrder + 1
- itemClone.itemExtraLabel.Text = ""
- itemClone.itemNameLabel.Text = string.upper(string.sub(itemName, 1, 1)) .. string.lower(string.sub(itemName, 2)) .." " .. string.upper(string.sub(itemType, 1, 1)) .. string.lower(string.sub(itemType, 2))
- itemClone.itemPriceLabel.Text = "$" .. price
- print(string.upper(string.sub(itemName, 1, 1)) .. string.lower(string.sub(itemName, 2)))
- itemsInOrder = itemsInOrder + 1
- totalOrderPrice = totalOrderPrice + price
- print("$" .. totalOrderPrice)
- local CreateShowTween = TweenService:Create(Blur1, Info, HideTweenPrm)
- CreateShowTween:Play()
- local toppingsFrame = script.Parent.OrderingSystem.toppingsFrame
- toppingsFrame:TweenPosition(UDim2.new(0.35, 0,0.35, 0), nil, nil, 2)
- print()
- end
- function orderingSystem.addToppingsToIcecream(extra)
- local CreateShowTween = TweenService:Create(Blur1, Info, ShowTweenPrm)
- CreateShowTween:Play()
- if extra == "gummyBears" then
- extra = "Gummy Bears"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- end
- if extra == "crushedOreo" then
- extra = "Crushed Oreos"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- end
- if extra == "chocolateChips" then
- extra = "Chocolate Chips"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- end
- if extra == "sprinkles" then
- extra = "Sprinkles"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- end
- if extra == "skip" then
- extra = "No Toppings"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- end
- print("Found item " .. itemsInOrder)
- local toppingsFrameTween = TweenService:Create(toppingsFrame, Info2, HideToppingsParam)
- toppingsFrameTween:Play()
- print(totalOrderPrice)
- script.Parent.OrderingSystem.SendButton.Text = "Charge Customer $" .. totalOrderPrice
- game.Players[script.Parent.Parent.Parent.Cashier.Value].IsMakingOrder.Value = false
- end
- end
- if itemType == "SMOOTHIE" then
- if from ~= "size" then
- print(extra)
- local itemClone = script.Parent.sampleItem:Clone()
- itemClone.Parent = script.Parent.OrderingSystem.OrderList
- itemClone.Name = itemsInOrder + 1
- itemClone.itemExtraLabel.Text = ""
- itemClone.itemNameLabel.Text = string.upper(string.sub(itemName, 1, 1)) .. string.lower(string.sub(itemName, 2)) .." " .. string.upper(string.sub(itemType, 1, 1)) .. string.lower(string.sub(itemType, 2))
- itemClone.itemPriceLabel.Text = "$" .. price
- print(string.upper(string.sub(itemName, 1, 1)) .. string.lower(string.sub(itemName, 2)))
- itemsInOrder = itemsInOrder + 1
- totalOrderPrice = totalOrderPrice + price
- print("$" .. totalOrderPrice)
- local CreateShowTween = TweenService:Create(Blur1, Info, HideTweenPrm)
- CreateShowTween:Play()
- sizeFrame:TweenPosition(UDim2.new(0.35, 0,0.35, 0), nil, nil, 2)
- print()
- end
- function orderingSystem.addSizeToSmoothie(extra)
- local CreateShowTween = TweenService:Create(Blur1, Info, ShowTweenPrm)
- CreateShowTween:Play()
- if extra == "small" then
- extra = "Small"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- price = 5
- end
- if extra == "large" then
- extra = "Large"
- script.Parent.OrderingSystem.OrderList:FindFirstChild(itemsInOrder).itemExtraLabel.Text = extra
- price = 7
- end
- print("Found item " .. itemsInOrder)
- local sizeFrameTween = TweenService:Create(sizeFrame, Info2, HideToppingsParam)
- sizeFrameTween:Play()
- print(totalOrderPrice)
- script.Parent.OrderingSystem.SendButton.Text = "Charge Customer $" .. totalOrderPrice
- game.Players[script.Parent.Parent.Parent.Cashier.Value].IsMakingOrder.Value = false
- end
- end
- else
- return orderingSystem
- end
- end
- function orderingSystem.completeOrder()
- --{0.35, 0},{0.35, 0}
- customerWaitFrame:TweenPosition(UDim2.new(0.35, 0,0.35, 0),nil, nil, 2)
- local CreateShowTween = TweenService:Create(Blur1, Info, HideTweenPrm)
- CreateShowTween:Play()
- script.Parent.Parent.Parent.Reader.Prompt.ProximityPrompt.ActionText = "Pay $" .. totalOrderPrice
- script.Parent.Parent.Parent.Reader.Prompt.ProximityPrompt.Enabled = true
- 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 CashierName = script.Parent.Parent.Parent.Cashier.Value
- script.Parent.Parent.Parent.Reader.Prompt.ProximityPrompt.Enabled = false
- print(Player.Name .. "'s order was just submitted.")
- game.Players[Player.Name].leaderstats.Coins.Value = game.Players[Player.Name].leaderstats.Coins.Value - totalOrderPrice
- ------------------------
- customerWaitFrame.Body.Text = "Transaction Approved!"
- 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"
- wait(2)
- 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
- end
- return orderingSystem
Advertisement
Add Comment
Please, Sign In to add comment