Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RunService = game:GetService("RunService")
- local DamageService = require(game.ServerScriptService.Modules.DamageService)
- local TargetService = require(game.ServerScriptService.Modules.TargetService)
- local TweenService = require(game.ServerScriptService.Modules.TweenService)
- local BezierCurves = require(game.ServerScriptService.Modules.BezierCurves)
- local MoveRemotes = game.ReplicatedStorage:WaitForChild("MoveRemotes")
- local event = MoveRemotes["Robux Sucker 3000"]
- local function setUpDevice(device)
- local goal = {Value = device.Stage2:GetPrimaryPartCFrame() + Vector3.new(0,0.85,0)}
- local properties = {Time = 0.5, Style = Enum.EasingStyle.Elastic, Dir = Enum.EasingDirection.Out}
- local CFrameValue = Instance.new("CFrameValue")
- CFrameValue.Value = device.Stage2:GetPrimaryPartCFrame()
- local CFrameWatch = CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
- device.Stage2:SetPrimaryPartCFrame(CFrameValue.Value)
- end)
- local tween = TweenService.tween(CFrameValue, goal, properties)
- tween.Completed:Connect(function()
- CFrameValue:Destroy()
- CFrameWatch:Disconnect()
- device.Stage2.Light.Transparency = 0
- device.Stage2.Light.Material = "Neon"
- device.Stage2.Light.BrickColor = BrickColor.new("Lime green")
- end)
- end
- local function makeConnection(device, connections, character)
- local status = true
- for i,v in pairs(connections) do
- if v.address == character then
- status = false
- end
- end
- if not status then return connections end
- local beam = game.ServerStorage.Storage.RobuxBeam:Clone()
- beam.Name = character.Name
- beam.Parent = device
- local newAttachment = Instance.new("Attachment")
- newAttachment.Parent = character.HumanoidRootPart
- newAttachment.Position = Vector3.new(0,0,0)
- newAttachment.Name = "RobuxSiphon"
- beam.Attachment0 = newAttachment
- beam.Attachment1 = device.Stage2.Light.Base
- connections[character.Name] = {beam, newAttachment, address = character}
- return connections
- end
- local function explosion(device)
- local explosion1 = game.ServerStorage.Storage.RobuxExplosionPart1:Clone()
- local explosion2 = game.ServerStorage.Storage.RobuxExplosionPart2:Clone()
- local particles = game.ServerStorage.Storage.RobuxExplosionParticles:Clone()
- local part = Instance.new("Part")
- part.Size = Vector3.new(1,1,1)
- part.Anchored = true
- part.Transparency = 1
- part.CanCollide = false
- part.CFrame = CFrame.new(device.PrimaryPart.Position)
- part.Parent = workspace
- game.Debris:AddItem(part, 1.5)
- particles.Parent = part
- explosion1.Parent = workspace
- explosion2.Parent = workspace
- game.Debris:AddItem(explosion1, 1.5)
- game.Debris:AddItem(explosion2, 1.5)
- explosion1.CFrame = CFrame.new(device.PrimaryPart.Position)
- explosion2.CFrame = CFrame.new(device.PrimaryPart.Position)
- local goal = {Size = Vector3.new(30,30,30), Transparency = 1}
- local properties = {Dir = Enum.EasingDirection.InOut, Style = Enum.EasingStyle.Back, Time = 1}
- TweenService.tween(explosion1, goal, properties)
- TweenService.tween(explosion2, goal, properties)
- coroutine.resume(coroutine.create(function()
- wait(0.75)
- particles.Enabled = false
- end))
- end
- event.OnServerEvent:Connect(function(player, details, pos)
- local bezCurveVals = {i = 0, startPos = 0, control = 0, pos = 0, val = 0}
- local active = false
- local connections = {}
- local function bezCurve()
- wait(0.01)
- BezierCurves.Quadratic(bezCurveVals.i, bezCurveVals.startPos, bezCurveVals.control, bezCurveVals.pos, bezCurveVals.val, "Value", CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(-90), 0))
- bezCurveVals.val.Value = bezCurveVals.val.Value
- bezCurveVals.i = bezCurveVals.i + 5
- end
- local device = game.ServerStorage.Storage["Robux Device"]:Clone()
- device.Parent = workspace
- device:SetPrimaryPartCFrame(player.Character.LeftHand.CFrame)
- local weld = Instance.new("Weld")
- weld.Parent = player.Character.LeftHand
- weld.Part0 = weld.Parent
- weld.Part1 = device.PrimaryPart
- local animation = Instance.new("Animation")
- animation.AnimationId = "http://www.roblox.com/Asset?ID="..details.animations.main
- local track = player.Character.Humanoid:LoadAnimation(animation)
- track:Play()
- track.KeyframeReached:Connect(function(keyframe)
- if keyframe == "Throw" then
- weld:Destroy()
- for i,v in pairs(device:GetDescendants()) do
- if v:IsA("BasePart") then
- v.Anchored = true
- end
- end
- local startPos = device.PrimaryPart.CFrame
- local midpoint = (device.PrimaryPart.Position + pos)/2
- local control = CFrame.new(midpoint) * CFrame.new(0,10,0)
- local CFrameValue = Instance.new("CFrameValue")
- CFrameValue.Parent = device
- CFrameValue.Value = device:GetPrimaryPartCFrame()
- local CFrameWatch = CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
- device:SetPrimaryPartCFrame(CFrameValue.Value)
- end)
- bezCurveVals.i = 0
- bezCurveVals.startPos = startPos
- bezCurveVals.control = control
- bezCurveVals.pos = CFrame.new(pos)
- bezCurveVals.val = CFrameValue
- local onHeart = RunService.Heartbeat:Connect(bezCurve)
- repeat wait() until bezCurveVals.i >= 100
- active = true
- device:SetPrimaryPartCFrame(device.PrimaryPart.CFrame + Vector3.new(0,-1,0))
- setUpDevice(device)
- onHeart:Disconnect()
- CFrameWatch:Disconnect()
- end
- end)
- repeat wait() until active
- game.Debris:AddItem(device, details.duration+1.5)
- coroutine.resume(coroutine.create(function()
- wait(details.duration)
- active = false
- for i,v in pairs(device:GetDescendants()) do
- if v:IsA("BasePart") then
- local goal = {Transparency = 1}
- local properties = {Dir = Enum.EasingDirection.Out, Style = Enum.EasingStyle.Sine, Time = 1.5}
- TweenService.tween(v, goal, properties)
- end
- end
- end))
- local healAmount = 0
- while active do
- local targets = TargetService.findMagNpc(player, device.PrimaryPart, details.mag, details.targets)
- for i,v in pairs(targets) do
- connections = makeConnection(device, connections, v)
- end
- for i,v in pairs(connections) do
- local status = false
- for j,k in pairs(targets) do
- if k == v.address then
- status = true
- end
- end
- if not status then
- for n,m in pairs(v) do
- m:Destroy()
- end
- connections[i] = nil
- end
- end
- if #targets > 0 then
- DamageService.npcDamage(player, targets, details)
- end
- for i,v in pairs(targets) do
- healAmount = healAmount + details.dmg * details.steal
- end
- wait(0.5)
- end
- explosion(device)
- wait(0.2)
- local healTargets = TargetService.findMagAllies(player, device.PrimaryPart, 30, details.targets)
- details.heal = healAmount
- if #healTargets > 0 then
- DamageService.playerHeal(player, healTargets, details)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement