Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---████████--██████ ██████ ███ ██ █████ ██████ ██████
- ------██ --██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██
- ------██ --██ ██ ██ ██████ ██ ██ ██ ███████ ██ ██ ██ ██
- ------██ --██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ a modified version of Super Ring
- ------██ --██████ ██ ██ ██ ████ ██ ██ ██████ ██████ v.1 by TC123
- -- 'P' to activate/deactivate
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local SoundService = game:GetService("SoundService")
- local StarterGui = game:GetService("StarterGui")
- local TextChatService = game:GetService("TextChatService")
- local LocalPlayer = Players.LocalPlayer
- -- Sound Effects
- local function playSound(soundId)
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://" .. soundId
- sound.Parent = SoundService
- sound:Play()
- sound.Ended:Connect(function()
- sound:Destroy()
- end)
- end
- -- Play initial sound
- playSound("2865227271")
- -- Ring Parts Logic
- if not getgenv().Network then
- getgenv().Network = {
- BaseParts = {},
- Velocity = Vector3.new(14.46262424, 14.46262424, 14.46262424)
- }
- Network.RetainPart = function(Part)
- if Part:IsDescendantOf(workspace) then
- table.insert(Network.BaseParts, Part)
- Part.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- Part.CanCollideCanCollide = false
- end
- end
- local function EnablePartControl()
- LocalPlayer.ReplicationFocus = workspace
- RunService.Heartbeat:Connect(function()
- sethiddenproperty(LocalPlayer, "SimulationRadius", math.huge)
- for index, part in ipairs(Network.BaseParts) do
- if Part:IsDescendantOf(workspace) then
- Part.Velocity = Network.Velocity
- end
- end
- end)
- end
- EnablePartControl()
- end
- local radius = 10
- local height = 100
- local rotationSpeed = 0.05
- local attractionStrength = 100
- local ringPartsEnabled = false
- local function RetainPart(Part)
- if Part:IsA("BasePart") and not Part.Anchored and Part:IsDescendantOf(workspace) then
- if Part.Parent == LocalPlayer.Character or Part:IsDescendantOf(LocalPlayer.Character) then
- return false
- end
- Part.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- Part.CanCollide = false
- return true
- end
- return false
- end
- local parts = {}
- local function addPart(part)
- if RetainPart(part) then
- --if not table.find(parts, part) then
- table.insert(parts, part)
- --end
- end
- end
- local function removePart(part)
- local index = table.find(parts, part)
- if index then
- table.remove(parts, index)
- end
- end
- for index, part in ipairs(workspace:GetDescendants()) do
- addPart(part)
- end
- workspace.DescendantAdded:Connect(addPart)
- workspace.DescendantRemoving:Connect(removePart)
- RunService.Heartbeat:Connect(function()
- if not ringPartsEnabled then return end
- local counter = 0
- local humanoidRootPart = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
- humanoidRootPart.CFrame = humanoidRootPart.CFrame * CFrame.Angles(0, math.rad(-36.0), 0)
- if humanoidRootPart then
- local tornadoCenter = humanoidRootPart.Position
- for index, part in ipairs(parts) do
- if part.Parent and not part.Anchored then
- local ms = tick()
- local pos = part.Position
- local distance = (Vector3.new(pos.X, tornadoCenter.Y, pos.Z) - tornadoCenter).Magnitude
- local angle = math.atan2(pos.Z - tornadoCenter.Z, pos.X - tornadoCenter.X)
- local newAngle = angle + math.rad(rotationSpeed)
- local newHeight = (index % 2)*(0.01 + (math.cos(ms*3+newAngle*1))*0.005+(math.sin(ms*3+newAngle*1))*0.005)
- local newHeightOdd = (1.1+ (index % 2))*(0.01 + (math.cos(ms*2+newAngle*1))*0.005+(math.sin(ms*2+newAngle*1))*-0.005)
- local targetPos = Vector3.new(
- tornadoCenter.X + math.cos(newAngle) * math.min(radius+newHeightOdd, distance),
- tornadoCenter.Y + (height * (math.abs(math.sin((pos.Y - tornadoCenter.Y) / height)))) + newHeight+newHeightOdd,
- tornadoCenter.Z + math.sin(newAngle) * math.min(radius+newHeightOdd, distance)
- )
- -- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.Angles(0, math.rad(-0.7), 0)
- local directionToTarget = (targetPos - part.Position).unit
- part.Velocity = directionToTarget * attractionStrength
- end
- end
- end
- end)
- -- Toggle ringPartsEnabled on keypress "P"
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.P then
- ringPartsEnabled = not ringPartsEnabled
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement