Advertisement
Sombody101

FormattedScript

May 28th, 2022
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.44 KB | None | 0 0
  1. local delToollocal
  2. function FindFirstDeliveryTool()
  3.     local children = workspace:GetChildren()
  4.     for i = 1, #children do
  5.         local v = children[i]
  6.         if
  7.             v.ClassName == "Tool" and v.Name:match("^%u%d$") and ffc(v, "House") and ffc(v, "Handle") and
  8.                 ffc(v, "Order") and
  9.                 v.Order.Value:match("%a")
  10.          then
  11.             if ffc(v.Handle, "X10") then
  12.                 return v
  13.             end
  14.             t = v
  15.         end
  16.     end
  17.     return t
  18. end
  19. local function getHousePart(address)
  20.     local houses = workspace.Houses:GetChildren()
  21.     for i = 1, #houses do
  22.         local h = houses[i]
  23.         if
  24.             ffc(h, "Address") and h.Address.Value == address and ffc(h, "Upgrades") and h.Upgrades:GetChildren()[1] and
  25.                 ffc(h.Upgrades:GetChildren()[1], "GivePizza")
  26.          then
  27.             return h.Upgrades:GetChildren()[1].GivePizza
  28.         end
  29.     end
  30. end
  31. local delTouched = false
  32. local function forgetDeliveryTool()
  33.     if delTool then
  34.         if delTool.Parent == player.Backpack then
  35.             delTool.Parent = character
  36.         end
  37.         if delTool.Parent == character then
  38.             wait(0.1)
  39.             delTool.Parent = workspace
  40.             wait(0.1)
  41.         end
  42.     end
  43.     delTool = nil
  44.     delTouched = false
  45.     if ffc(character, "RightHand") and ffc(character.RightHand, "RightGrip") then
  46.         character.RightHand.RightGrip:Destroy()
  47.     end
  48. end
  49. local function onCharacterAdded(char)
  50.     if not char then
  51.         return
  52.     end
  53.     character = char
  54.     root = character:WaitForChild("HumanoidRootPart")
  55.     character:WaitForChild("Humanoid"):GetPropertyChangedSignal("WalkSpeed"):Connect(
  56.         function()
  57.             if delTool then
  58.                 character.Humanoid.WalkSpeed = 16
  59.             end
  60.         end
  61.     )
  62. end
  63. onCharacterAdded(player.Character or player.CharacterAdded:Wait())
  64. player.CharacterAdded:Connect(onCharacterAdded)
  65. local function simTouch(part)
  66.     local oldcc = part.CanCollide
  67.     local oldcf = part.CFrame
  68.     part.CanCollide = false
  69.     part.CFrame =
  70.         root.CFramedelay(
  71.         0.01,
  72.         function()
  73.             part.CFrame = oldcf
  74.             part.CanCollide = oldcc
  75.         end
  76.     )
  77. end
  78. while gui.Parent do
  79.     wait(0.3)
  80.     local hum = character:FindFirstChild("Humanoid")
  81.     if hum and hum.Sit then
  82.         hum.Jump = true
  83.     end
  84.     if doCashier then
  85.         local c = FindFirstCustomer()
  86.         if c then
  87.             local dialog = c.Head.Dialog.Correct.ResponseDialog or ""
  88.             local rootMoved = false
  89.             if (root.Position - Vector3.new(46.34, 3.80, 82.02)).magnitude > 9 then
  90.                 rootMoved = true
  91.                 root.CFrame = CFrame.new(46.34, 3.80, 82.02)
  92.                 wait(.1)
  93.             end
  94.             local order = "MountainDew"
  95.             if dialog:sub(-8) == "instead." then
  96.                 dialog = dialog:sub(-30)
  97.             end
  98.             if dialog:find("pepperoni", 1, true) then
  99.                 order = "PepperoniPizza"
  100.             elseif dialog:find("sausage", 1, true) then
  101.                 order = "SausagePizza"
  102.             elseif dialog:find("cheese", 1, true) then
  103.                 order = "CheesePizza"
  104.                 endnetwork:FireServer("OrderComplete", c, order, workspace.Register3)
  105.                 if rootMoved then
  106.                     wait(.1)
  107.                 end
  108.             end
  109.         end
  110.     end
  111. end
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement