Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService, rs, lp = game:GetService("TweenService"), game:GetService("RunService"), game:GetService("Players").LocalPlayer
- local noclipE, antifall
- local function noclip()
- for _, v in pairs(lp.Character:GetDescendants()) do
- if v:IsA("BasePart") then v.CanCollide = false end
- end
- lp.Character.HumanoidRootPart.Velocity = Vector3.zero
- end
- local function moveto(obj, speed)
- local info = TweenInfo.new((lp.Character.HumanoidRootPart.Position - obj.Position).Magnitude / speed, Enum.EasingStyle.Linear)
- local tween = TweenService:Create(lp.Character.HumanoidRootPart, info, {CFrame = obj.CFrame + Vector3.new(0, -5, 0)})
- if not lp.Character.HumanoidRootPart:FindFirstChild("BodyVelocity") then
- antifall = Instance.new("BodyVelocity", lp.Character.HumanoidRootPart)
- antifall.Velocity = Vector3.zero
- noclipE = rs.Stepped:Connect(noclip)
- tween:Play()
- end
- tween.Completed:Connect(function() antifall:Destroy() noclipE:Disconnect() end)
- end
- rs.RenderStepped:Connect(function()
- local closestBin = nil
- local closestDistance = math.huge
- for _, location in pairs(workspace.BinmanJob.Bins:GetChildren()) do
- local prompt = location:FindFirstChild("ProximityPrompt")
- if prompt and prompt.Enabled then
- local distance = (lp.Character.HumanoidRootPart.Position - location.Position).Magnitude
- if distance < closestDistance then
- closestDistance = distance
- closestBin = location
- end
- end
- end
- if closestBin then
- local prompt = closestBin:FindFirstChild("ProximityPrompt")
- prompt.Exclusivity = "AlwaysShow"
- prompt.MaxActivationDistance = 20
- prompt.RequiresLineOfSight = false
- moveto(closestBin, 70)
- fireproximityprompt(prompt, 1, true)
- else
- local destination = Instance.new("Part")
- destination.Position = Vector3.new(-258.686, 23.944, 533.438)
- moveto(destination, 70)
- local args = {
- [1] = workspace:WaitForChild("BinmanJob"):WaitForChild("StartJob"):WaitForChild("Start Job"):WaitForChild("ProximityPrompt")
- }
- game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("Quit"):FireServer(unpack(args))
- if workspace.BinmanJob.StartJob:FindFirstChild("Start Job") then
- fireproximityprompt(workspace.BinmanJob.StartJob["Start Job"].ProximityPrompt, 1, true)
- end
- destination:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement