MaxproGlitcher

Chair pizza place manager

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