Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Character = LocalPlayer.Character
- local Origin = Vector3.new(213, 124, -1872)
- local function ComputeTweenDistance(Pos1, Pos2)
- return (Pos1 - Pos2).magnitude / 50
- end
- local function WaitUntilPartSpawns(Part)
- local New
- repeat
- New = workspace.ChildAdded:Wait()
- until New.Name == Part
- end
- local function WaitUntilPartRemoved(Part)
- local New
- repeat
- New = workspace.ChildRemoved:Wait()
- until New.Name == Part
- end
- task.wait(1)
- while task.wait() do
- for i, CapturablePoint in pairs(workspace.ControlPoints:GetChildren()) do
- if CapturablePoint.Name == "Small Outpost" then
- if not (CapturablePoint:GetAttribute("ControlPoint_OwnerUserId") == LocalPlayer.UserId) then
- if CapturablePoint:FindFirstChild("ControlPointCore") and CapturablePoint.ControlPointCore:FindFirstChild("HitboxOrigin") then
- if LocalPlayer.Character then
- local Position = CapturablePoint.ControlPointCore.HitboxOrigin.Position
- local Tween = TweenService:Create(Character.HumanoidRootPart, TweenInfo.new(ComputeTweenDistance(Position, Character.HumanoidRootPart.Position), Enum.EasingStyle.Linear), {CFrame = CFrame.new(Position)})
- Tween:Play()
- Tween.Completed:Wait()
- repeat
- task.wait()
- until CapturablePoint:GetAttribute("ControlPoint_OwnerUserId") == LocalPlayer.UserId
- if not LocalPlayer.Character then
- break
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement