Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local PlayerGui = Player:WaitForChild("PlayerGui")
- local Character = Player.Character
- local Mouse = Player:GetMouse()
- local Debounce = false
- Mouse.KeyDown:Connect(function(k)
- if not Debounce then
- if string.lower(k) == "e" then
- Debounce = true
- local Circle = Instance.new("Part")
- local Screen = Instance.new("ScreenGui")
- local Viewport = Instance.new("ViewportFrame")
- local Camera = Instance.new("Camera")
- Circle.Parent=workspace
- Screen.Parent=PlayerGui
- Viewport.Parent=Screen
- Camera.Parent=Screen
- Screen.Name = "CircleFind"
- Viewport.Name = "ViewportFind"
- Camera.Name = "ViewportCamera"
- Camera.CFrame = Circle.CFrame + Vector3.new(3,3,0)
- Viewport.Size = UDim2.new(0.1,0,0.2,0)
- Viewport.Position = UDim2.new(0,0,0.8,0)
- Viewport.CurrentCamera = Camera
- Viewport.BorderSizePixel = 0
- Circle.Shape = Enum.PartType.Cylinder
- Circle.Size = Vector3.new(0.2,2,2)
- Circle.CFrame = Circle.CFrame * CFrame.Angles(0,0,math.rad(90))
- Circle.BrickColor = BrickColor.new("Lime green")
- Circle.Material = Enum.Material.SmoothPlastic
- Circle.Anchored = true
- Circle.CanCollide = false
- local Break = false
- local Position = CFrame.new()
- local Connection = Mouse.Button1Down:Connect(function()
- Break = true
- end)
- while true do
- local connect = Mouse.Move:Connect(function()
- hit = Mouse.Hit.Position
- end)
- if hit ~= nil then
- Circle.CFrame = Circle.CFrame:Lerp(CFrame.new(hit) * CFrame.Angles(0,0,math.rad(90)),0.3)
- end
- for _,v in pairs(workspace:GetChildren()) do
- if v:IsA("Terrain") or v:IsA("Camera") or v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("LocalScript") then else
- if not v.Archivable then
- v.Archivable = true
- local clo = v:Clone()
- v.Archivable = false
- if v:IsA("Part") or v:IsA("BasePart") or v:IsA("UnionOperation") then
- if (Circle.Position-clo.Position).Magnitude <= 50 then
- clo.Parent = Viewport
- end
- elseif clo:IsA("Model") and (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part")) then
- local part = (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part"))
- if (Circle.Position-part.Position).Magnitude <= 50 then
- clo.Parent = Viewport
- for _,c in pairs(clo:GetDescendants()) do
- if c:IsA("Camera") or c:IsA("Script") or c:IsA("ModuleScript") or c:IsA("LocalScript") then
- c:Destroy()
- elseif c:IsA("Humanoid") then
- c.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- c.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- c.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- end
- end
- end
- end
- else
- local clo = v:Clone()
- if v:IsA("Part") or v:IsA("BasePart") or v:IsA("UnionOperation") then
- if (Circle.Position-clo.Position).Magnitude <= 50 then
- clo.Parent = Viewport
- end
- elseif clo:IsA("Model") and (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part")) then
- local part = (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part"))
- if (Circle.Position-part.Position).Magnitude <= 50 then
- clo.Parent = Viewport
- for _,c in pairs(clo:GetDescendants()) do
- if c:IsA("Camera") or c:IsA("Script") or c:IsA("ModuleScript") or c:IsA("LocalScript") then
- c:Destroy()
- elseif c:IsA("Humanoid") then
- c.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- c.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- c.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- end
- end
- end
- end
- end
- end
- end
- Camera.CFrame = (Circle.CFrame + Vector3.new(5,3,0)) * CFrame.Angles(0,0,math.rad(-90))
- game:GetService("RunService").Heartbeat:Wait()
- connect:Disconnect()
- for _,v in pairs(Viewport:GetDescendants()) do
- v:Destroy()
- end
- if Break then
- Position = Circle.CFrame
- Screen:Destroy()
- Circle:Destroy()
- break
- end
- end
- if Break then
- Character.PrimaryPart.Anchored = true
- Position = (Position+Vector3.new(0,2,0))*CFrame.Angles(0,0,math.rad(-90))
- for i = 0,1,0.15 do
- Character:SetPrimaryPartCFrame(Character.PrimaryPart.CFrame:Lerp(Character.PrimaryPart.CFrame+Vector3.new(0,2,0),i))
- wait()
- end
- wait(1)
- for i = 0,1,0.15 do
- Character:SetPrimaryPartCFrame(Character.PrimaryPart.CFrame:Lerp(Position,i))
- wait()
- end
- wait()
- Character:SetPrimaryPartCFrame(Position)
- wait(1)
- Character.PrimaryPart.Anchored = false
- Debounce = false
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement