Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Workspace = game:GetService("Workspace")
- local StarterGui = game:GetService("StarterGui")
- local TweenService = game:GetService("TweenService")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local blackHole = nil
- local Attachment1 = Instance.new("Attachment")
- local MAX_SIMULATION_RADIUS = 90000
- local BLACK_HOLE_SIZE = Vector3.new(5, 5, 5)
- local BLACK_HOLE_COLOR = Color3.fromRGB(0, 0, 0)
- local BLACK_HOLE_GLOW_RANGE = 20
- local BLACK_HOLE_GLOW_BRIGHTNESS = 10
- local BLACK_HOLE_GLOW_COLOR = Color3.fromRGB(0, 0, 255)
- local TORQUE_VECTOR = Vector3.new(100000, 100000, 100000)
- local ALIGN_POSITION_RESPONSIVENESS = 200
- local connections = {}
- local function setupNetworkAccess()
- settings().Physics.AllowSleep = false
- table.insert(connections, RunService.Heartbeat:Connect(function()
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= LocalPlayer then
- player.MaximumSimulationRadius = 0
- pcall(function() sethiddenproperty(player, "SimulationRadius", 0) end)
- end
- end
- LocalPlayer.MaximumSimulationRadius = MAX_SIMULATION_RADIUS
- pcall(function() setsimulationradius(MAX_SIMULATION_RADIUS) end)
- end))
- end
- local function applyForceToPart(part)
- if part:IsA("BasePart") and not part.Anchored and not part.Parent:FindFirstChildOfClass("Humanoid") and part.Name ~= "Handle" and part.Parent ~= LocalPlayer.Character then
- for _, child in ipairs(part:GetChildren()) do
- if child:IsA("BodyMover") or child:IsA("RocketPropulsion") then
- child:Destroy()
- end
- end
- local attachment = part:FindFirstChild("Attachment")
- if attachment then attachment:Destroy() end
- local alignPosition = part:FindFirstChild("AlignPosition")
- if alignPosition then alignPosition:Destroy() end
- local torque = part:FindFirstChild("Torque")
- if torque then torque:Destroy() end
- part.CanCollide = false
- local Attachment2 = Instance.new("Attachment", part)
- local Torque = Instance.new("Torque", part)
- Torque.Torque = TORQUE_VECTOR
- Torque.Attachment0 = Attachment2
- local AlignPosition = Instance.new("AlignPosition", part)
- AlignPosition.MaxForce = math.huge
- AlignPosition.MaxVelocity = math.huge
- AlignPosition.Responsiveness = ALIGN_POSITION_RESPONSIVENESS
- AlignPosition.Attachment0 = Attachment2
- AlignPosition.Attachment1 = Attachment1
- end
- end
- local function createOrMoveBlackHole(position)
- if blackHole then
- local tween = TweenService:Create(blackHole, TweenInfo.new(0.1), {Position = position})
- tween:Play()
- return
- end
- local Folder = Instance.new("Folder", Workspace)
- blackHole = Instance.new("Part", Folder)
- blackHole.Size = BLACK_HOLE_SIZE
- blackHole.Shape = Enum.PartType.Ball
- blackHole.Color = BLACK_HOLE_COLOR
- blackHole.Anchored = true
- blackHole.CanCollide = false
- blackHole.Material = Enum.Material.ForceField
- blackHole.Position = position
- local Glow = Instance.new("PointLight", blackHole)
- Glow.Color = BLACK_HOLE_GLOW_COLOR
- Glow.Range = BLACK_HOLE_GLOW_RANGE
- Glow.Brightness = BLACK_HOLE_GLOW_BRIGHTNESS
- local particleEmitter = Instance.new("ParticleEmitter", blackHole)
- particleEmitter.Texture = "rbxassetid://243098098"
- particleEmitter.Color = ColorSequence.new(Color3.fromRGB(0, 0, 0), Color3.fromRGB(0, 0, 255))
- particleEmitter.LightEmission = 1
- particleEmitter.Size = NumberSequence.new(1, 3)
- particleEmitter.Rate = 200
- particleEmitter.Lifetime = NumberRange.new(2)
- particleEmitter.Speed = NumberRange.new(5, 10)
- particleEmitter.Rotation = NumberRange.new(0, 360)
- particleEmitter.RotSpeed = NumberRange.new(-100, 100)
- particleEmitter.VelocitySpread = 180
- particleEmitter.Acceleration = Vector3.new(0, -1, 0)
- particleEmitter.EmissionDirection = Enum.NormalId.Front
- particleEmitter.ZOffset = 2
- local swirlingParticles = Instance.new("ParticleEmitter", blackHole)
- swirlingParticles.Texture = "rbxassetid://242617766"
- swirlingParticles.Color = ColorSequence.new(Color3.fromRGB(0, 0, 255), Color3.fromRGB(0, 0, 0))
- swirlingParticles.LightEmission = 0.75
- swirlingParticles.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.5), NumberSequenceKeypoint.new(1, 2)})
- swirlingParticles.Rate = 100
- swirlingParticles.Lifetime = NumberRange.new(2)
- swirlingParticles.Speed = NumberRange.new(0, 0)
- swirlingParticles.Rotation = NumberRange.new(0, 360)
- swirlingParticles.RotSpeed = NumberRange.new(-20, 20)
- swirlingParticles.VelocitySpread = 0
- swirlingParticles.EmissionDirection = Enum.NormalId.Front
- swirlingParticles.ZOffset = 2
- local sizeTweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true)
- local sizeTween = TweenService:Create(blackHole, sizeTweenInfo, {Size = BLACK_HOLE_SIZE * 1.5})
- sizeTween:Play()
- local sound = Instance.new("Sound", blackHole)
- sound.SoundId = "rbxassetid://5057664921"
- sound.Volume = 4
- sound.Looped = true
- sound:Play()
- local BillboardGui = Instance.new("BillboardGui", blackHole)
- BillboardGui.Size = UDim2.new(0, 75, 0, 75)
- BillboardGui.AlwaysOnTop = true
- BillboardGui.StudsOffset = Vector3.new(0, 4, 0)
- local TextLabel = Instance.new("TextLabel", BillboardGui)
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Text = "!"
- TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
- TextLabel.BackgroundTransparency = 1
- TextLabel.TextScaled = true
- Attachment1.Parent = blackHole
- Attachment1.Position = Vector3.new(0, 0, 0)
- for _, v in ipairs(Workspace:GetDescendants()) do
- applyForceToPart(v)
- end
- table.insert(connections, Workspace.DescendantAdded:Connect(function(v)
- applyForceToPart(v)
- end))
- end
- local function cleanup()
- if blackHole then
- blackHole:Destroy()
- blackHole = nil
- end
- for _, connection in ipairs(connections) do
- connection:Disconnect()
- end
- connections = {}
- StarterGui:SetCore("SendNotification", {
- Title = "Attractor",
- Text = "The Attractor was removed. Execute again to create.",
- Duration = 2
- })
- end
- local function onInputBegan(input, gameProcessedEvent)
- if input.KeyCode == Enum.KeyCode.E and not gameProcessedEvent then
- local position = Mouse.Hit.p
- createOrMoveBlackHole(position)
- StarterGui:SetCore("SendNotification", {
- Title = "Attractor",
- Text = "Attractor was created or moved.",
- Duration = 2
- })
- elseif input.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent then
- cleanup()
- end
- end
- local function initializeScript()
- table.insert(connections, UserInputService.InputBegan:Connect(onInputBegan))
- setupNetworkAccess()
- StarterGui:SetCore("SendNotification", {
- Title = "Script Executed",
- Text = "Press 'E' to create/move the Attractor. Press 'Q' to remove it.",
- Duration = 5
- })
- end
- local function createShittyUI()
- local ScreenGui = Instance.new("ScreenGui", LocalPlayer.PlayerGui)
- ScreenGui.Name = "BlackHoleUI"
- ScreenGui.ResetOnSpawn = false
- local Frame = Instance.new("Frame", ScreenGui)
- Frame.Size = UDim2.new(0, 400, 0, 300)
- Frame.Position = UDim2.new(0.5, -200, 0.5, -150)
- Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- Frame.BorderSizePixel = 0
- local UICorner = Instance.new("UICorner", Frame)
- UICorner.CornerRadius = UDim.new(0, 10)
- local TitleBar = Instance.new("Frame", Frame)
- TitleBar.Size = UDim2.new(1, 0, 0, 30)
- TitleBar.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- TitleBar.BorderSizePixel = 0
- local TitleLabel = Instance.new("TextLabel", TitleBar)
- TitleLabel.Size = UDim2.new(1, -30, 1, 0)
- TitleLabel.Position = UDim2.new(0, 10, 0, 0)
- TitleLabel.Text = "NOTE"
- TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.TextScaled = true
- TitleLabel.Font = Enum.Font.GothamBold
- local CloseButton = Instance.new("TextButton", TitleBar)
- CloseButton.Size = UDim2.new(0, 30, 0, 30)
- CloseButton.Position = UDim2.new(1, -30, 0, 0)
- CloseButton.Text = "X"
- CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- CloseButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- CloseButton.BorderSizePixel = 0
- CloseButton.TextScaled = true
- CloseButton.Font = Enum.Font.GothamBold
- local UpdateBox = Instance.new("TextLabel", Frame)
- UpdateBox.Size = UDim2.new(1, -20, 1, -50)
- UpdateBox.Position = UDim2.new(0, 10, 0, 40)
- UpdateBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- UpdateBox.BorderSizePixel = 0
- UpdateBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- UpdateBox.Text = "want this shit updated? give me funds! :)"
- UpdateBox.TextScaled = true
- UpdateBox.Font = Enum.Font.Gotham
- UpdateBox.TextWrapped = true
- UpdateBox.ClipsDescendants = true
- local UICorner2 = Instance.new("UICorner", UpdateBox)
- UICorner2.CornerRadius = UDim.new(0, 10)
- local function makeFrameDraggable(frame, handle)
- local dragging
- local dragInput
- local dragStart
- local startPos
- local function update(input)
- local delta = input.Position - dragStart
- frame:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true)
- end
- handle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- handle.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- end
- makeFrameDraggable(Frame, TitleBar)
- CloseButton.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- end)
- end
- createShittyUI()
- initializeScript()
Add Comment
Please, Sign In to add comment