yeoyeoyeoyayaya

Untitled

Feb 16th, 2023
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. local function getconnection(RBXScriptSignal,index)
  2. local connection = getconnections(RBXScriptSignal)[index]
  3. if connection then
  4. return connection
  5. end
  6. end
  7.  
  8. local Players = game:GetService("Players")
  9. local rs = game:GetService("RunService")
  10. if not Players.LocalPlayer then
  11. Players:GetPropertyChangedSignal("CFrame"):Wait()
  12. end
  13. local lp = Players.LocalPlayer
  14.  
  15. local HospitalJob = workspace:WaitForChild("Ignored"):WaitForChild("HospitalJob")
  16.  
  17. local Colors = {
  18. ["Red"] = HospitalJob:WaitForChild("Red"),
  19. ["Blue"] = HospitalJob:WaitForChild("Blue"),
  20. ["Green"] = HospitalJob:WaitForChild("Green")
  21. }
  22.  
  23. local function getchar()
  24. return lp.Character or lp.CharacterAdded:Wait()
  25. end
  26.  
  27. local function gethrp()
  28. return getchar():WaitForChild("HumanoidRootPart")
  29. end
  30.  
  31. local function getjobvalue()
  32. return getchar():WaitForChild("BodyEffects"):WaitForChild("HospitalJob")
  33. end
  34.  
  35. local working = false
  36. local function work(request)
  37. if not request:IsA("Model") then return end
  38. if working then
  39. repeat task.wait() until not working
  40. end
  41. working = true
  42.  
  43. local requestname = request.Name
  44. local Color = requestname:split(" ")[5]
  45. local ColorPart = Colors[Color]
  46. local requesthrp = request:WaitForChild("HumanoidRootPart")
  47. local requestclickdetector = request:WaitForChild("ClickDetector")
  48.  
  49. repeat
  50. gethrp().CFrame = ColorPart.CFrame
  51. rs.Heartbeat:Wait()
  52. fireclickdetector(ColorPart:FindFirstChildWhichIsA("ClickDetector"))
  53. until getjobvalue().Value == Color
  54.  
  55. repeat
  56. gethrp().CFrame = requesthrp.CFrame
  57. rs.Heartbeat:Wait()
  58. fireclickdetector(requestclickdetector)
  59. until not (request or request.Parent) or request.Name ~= requestname
  60. working = false
  61. end
  62.  
  63. local hrp = gethrp()
  64.  
  65. if getconnection(hrp:GetPropertyChangedSignal("CFrame"),1) then
  66. getconnection(hrp:GetPropertyChangedSignal("CFrame"),1):Disconnect()
  67. end
  68.  
  69. local con = HospitalJob.ChildAdded:Connect(work)
  70.  
  71. for i,v in next, HospitalJob:GetChildren() do
  72. work(v)
  73. end
  74.  
  75. getgenv().stop = function()
  76. getgenv().stop = nil
  77. con:Disconnect()
  78. warn("Autofarm stopping",con)
  79. end
Add Comment
Please, Sign In to add comment