Meliodas0_0

work at a pizza place-Manager

Jul 13th, 2019
23
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Players = game:GetService("Players")
  2. local player = Players.LocalPlayer
  3. local humanoid = player.Character.Humanoid
  4. local mteam = game:GetService("Teams").Manager
  5. local man = mteam:GetPlayers()[1]
  6. --deletes a glitchy chair in the office (optional)
  7. if workspace:FindFirstChild("ExtraChair") and workspace.ExtraChair:FindFirstChild("Seat") then
  8. workspace.ExtraChair.Seat:Destroy()
  9. end
  10.  
  11. if man then
  12. --check if he's respawning or sitting
  13. local htxt
  14. if man.Character==nil or man.Character:FindFirstChild("HumanoidRootPart")==nil or man.Character:FindFirstChild("Humanoid")==nil then
  15. htxt = "Failed because manager is respawning"
  16. end
  17. local target = man.Character.HumanoidRootPart
  18. if man.Character.Humanoid.Sit then
  19. htxt = "Failed because manager is sitting"
  20. end
  21. if htxt then
  22. local h = Instance.new("Hint",workspace)
  23. h.Text = htxt
  24. wait(3)
  25. h:Destroy()
  26. return
  27. end
  28. --get in a car
  29. if not workspace.Cars:IsAncestorOf(humanoid.SeatPart) then
  30. humanoid.Jump=true
  31. wait(0.1)
  32. for _,car in ipairs(workspace.Cars:GetChildren()) do
  33. if car:FindFirstChild("Driver") and car.Driver.Occupant==nil and car:FindFirstChild("Owner") and car.Owner.Value==nil then
  34. car.Driver:Sit(humanoid)
  35. wait(0.3)
  36. if humanoid.SeatPart then
  37. break
  38. end
  39. end
  40. end
  41. end
  42. local seat = humanoid.SeatPart
  43. local car = seat.Parent
  44. local returncf = CFrame.new(14,-4.5,21)*CFrame.Angles(0,math.pi/2,0)
  45. for j=1,4 do
  46. --attempt to sit manager
  47. seat.Anchored=false
  48. local e = 0
  49. while car.HoodSeat.Occupant==nil and mteam:GetPlayers()[1] and target.Parent and e<5 do
  50. local newpos = target.Position+Vector3.new(0,-3,0)+target.CFrame.lookVector*5.5+target.Velocity*.7
  51. local flatdir = (target.CFrame.lookVector*Vector3.new(1,0,1)).Unit --target's looking direction, flattened
  52. if not (flatdir.x < 2) then --inf
  53. flatdir = Vector3.new(1,0,0)
  54. end
  55. car:SetPrimaryPartCFrame(CFrame.new(newpos,newpos-flatdir))
  56. seat.Velocity=Vector3.new()
  57. local e2=0
  58. while car.HoodSeat.Occupant==nil and mteam:GetPlayers()[1] and target.Parent and e2<0.7 do
  59. e2=e2+wait()
  60. end
  61. e=e+e2
  62. end
  63. --attempt to move manager
  64. car:SetPrimaryPartCFrame(returncf)
  65. wait(.1)
  66. car:SetPrimaryPartCFrame(returncf)
  67. seat.Anchored=true
  68. e = 0
  69. while mteam:GetPlayers()[1] and target.Parent and e<1 do
  70. e=e+wait()
  71. end
  72. car.HoodSeat:ClearAllChildren() --unsits anyone
  73. e = 0
  74. while mteam:GetPlayers()[1] and target.Parent and e<0.5 do
  75. e=e+wait()
  76. end
  77. if mteam:GetPlayers()[1]==nil or target.Parent==nil then
  78. break
  79. end
  80. end
  81. --reset car
  82. seat.Anchored=false
  83. wait()
  84. car:SetPrimaryPartCFrame(CFrame.new(120,10,-75))
  85. wait()
  86. end
  87.  
  88. --become manager
  89. humanoid.Jump=true
  90. wait(0.1)
  91. pcall(function() workspace.ManagerChair.Seat:Sit(humanoid) end)
  92. wait(0.3)
  93. humanoid.Jump=true
  94. wait(0.1)
  95. player.Character.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame+Vector3.new(5,5,6)
RAW Paste Data