Advertisement
SQUIDMAN740

Release | [FE] Click Teleport Script

Mar 22nd, 2019
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.81 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local PlayerGui = Player:WaitForChild("PlayerGui")
  3. local Character = Player.Character
  4. local Mouse = Player:GetMouse()
  5. local Debounce = false
  6.  
  7. Mouse.KeyDown:Connect(function(k)
  8.    if not Debounce then
  9.        if string.lower(k) == "e" then
  10.            Debounce = true
  11.            local Circle = Instance.new("Part")
  12.            local Screen = Instance.new("ScreenGui")
  13.            local Viewport = Instance.new("ViewportFrame")
  14.            local Camera = Instance.new("Camera")
  15.            Circle.Parent=workspace
  16.            Screen.Parent=PlayerGui
  17.            Viewport.Parent=Screen
  18.            Camera.Parent=Screen
  19.            Screen.Name = "CircleFind"
  20.            Viewport.Name = "ViewportFind"
  21.            Camera.Name = "ViewportCamera"
  22.            Camera.CFrame = Circle.CFrame + Vector3.new(3,3,0)
  23.            Viewport.Size = UDim2.new(0.1,0,0.2,0)
  24.            Viewport.Position = UDim2.new(0,0,0.8,0)
  25.            Viewport.CurrentCamera = Camera
  26.            Viewport.BorderSizePixel = 0
  27.            Circle.Shape = Enum.PartType.Cylinder
  28.            Circle.Size = Vector3.new(0.2,2,2)
  29.            Circle.CFrame = Circle.CFrame * CFrame.Angles(0,0,math.rad(90))
  30.            Circle.BrickColor = BrickColor.new("Lime green")
  31.            Circle.Material = Enum.Material.SmoothPlastic
  32.            Circle.Anchored = true
  33.            Circle.CanCollide = false
  34.            local Break = false
  35.            local Position = CFrame.new()
  36.            local Connection = Mouse.Button1Down:Connect(function()
  37.                Break = true
  38.            end)
  39.            while true do
  40.                local connect = Mouse.Move:Connect(function()
  41.                    hit = Mouse.Hit.Position
  42.                end)
  43.                if hit ~= nil then
  44.                    Circle.CFrame = Circle.CFrame:Lerp(CFrame.new(hit) * CFrame.Angles(0,0,math.rad(90)),0.3)
  45.                end
  46.                for _,v in pairs(workspace:GetChildren()) do
  47.                    if v:IsA("Terrain") or v:IsA("Camera") or v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("LocalScript") then else
  48.                        if not v.Archivable then
  49.                            v.Archivable = true
  50.                            local clo = v:Clone()
  51.                            v.Archivable = false
  52.                            if v:IsA("Part") or v:IsA("BasePart") or v:IsA("UnionOperation") then
  53.                                if (Circle.Position-clo.Position).Magnitude <= 50 then
  54.                                    clo.Parent = Viewport
  55.                                end
  56.                            elseif clo:IsA("Model") and (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part")) then
  57.                                local part = (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part"))
  58.                                if (Circle.Position-part.Position).Magnitude <= 50 then
  59.                                    clo.Parent = Viewport
  60.                                    for _,c in pairs(clo:GetDescendants()) do
  61.                                        if c:IsA("Camera") or c:IsA("Script") or c:IsA("ModuleScript") or c:IsA("LocalScript") then
  62.                                            c:Destroy()
  63.                                        elseif c:IsA("Humanoid") then
  64.                                            c.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  65.                                            c.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  66.                                            c.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  67.                                        end
  68.                                    end
  69.                                end
  70.                            end
  71.                        else
  72.                            local clo = v:Clone()
  73.                            if v:IsA("Part") or v:IsA("BasePart") or v:IsA("UnionOperation") then
  74.                                if (Circle.Position-clo.Position).Magnitude <= 50 then
  75.                                    clo.Parent = Viewport
  76.                                end
  77.                            elseif clo:IsA("Model") and (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part")) then
  78.                                local part = (clo:FindFirstChildOfClass("UnionOperation") or clo:FindFirstChildOfClass("BasePart") or clo:FindFirstChildOfClass("Part"))
  79.                                if (Circle.Position-part.Position).Magnitude <= 50 then
  80.                                    clo.Parent = Viewport
  81.                                    for _,c in pairs(clo:GetDescendants()) do
  82.                                        if c:IsA("Camera") or c:IsA("Script") or c:IsA("ModuleScript") or c:IsA("LocalScript") then
  83.                                            c:Destroy()
  84.                                        elseif c:IsA("Humanoid") then
  85.                                            c.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  86.                                            c.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  87.                                            c.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  88.                                        end
  89.                                    end
  90.                                end
  91.                            end
  92.                        end
  93.                    end
  94.                end
  95.                Camera.CFrame = (Circle.CFrame + Vector3.new(5,3,0)) * CFrame.Angles(0,0,math.rad(-90))
  96.                game:GetService("RunService").Heartbeat:Wait()
  97.                connect:Disconnect()
  98.                for _,v in pairs(Viewport:GetDescendants()) do
  99.                    v:Destroy()
  100.                end
  101.                if Break then
  102.                    Position = Circle.CFrame
  103.                    Screen:Destroy()
  104.                    Circle:Destroy()
  105.                    break
  106.                end
  107.            end
  108.            if Break then
  109.                Character.PrimaryPart.Anchored = true
  110.                Position = (Position+Vector3.new(0,2,0))*CFrame.Angles(0,0,math.rad(-90))
  111.                for i = 0,1,0.15 do
  112.                            Character:SetPrimaryPartCFrame(Character.PrimaryPart.CFrame:Lerp(Character.PrimaryPart.CFrame+Vector3.new(0,2,0),i))
  113.                    wait()
  114.                end
  115.                wait(1)
  116.                for i = 0,1,0.15 do
  117.                    Character:SetPrimaryPartCFrame(Character.PrimaryPart.CFrame:Lerp(Position,i))
  118.                    wait()
  119.                end
  120.                wait()
  121.                Character:SetPrimaryPartCFrame(Position)
  122.                wait(1)
  123.                Character.PrimaryPart.Anchored = false
  124.                Debounce = false
  125.            end
  126.        end
  127.    end
  128. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement