Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local module = {}
- module.__index = module
- local Events = game:GetService('ReplicatedStorage'):WaitForChild('Events')
- local RunService = game:GetService('RunService')
- local TweenService = game:GetService('TweenService')
- local Debris = game:GetService('Debris')
- local Info = {}
- local Explosion = script:WaitForChild('Explosion')
- local Beam = script:WaitForChild('CenteredBeam')
- local Beam2 = script:WaitForChild('Target')
- local CameraShakeModule = script.Parent.Parent.Parent:WaitForChild('CameraShaker')
- local CameraShaker = require(CameraShakeModule)
- local ShakePreset = require(CameraShakeModule.CameraShakePresets).Earthquake
- module.Enabled = true
- local function renderSkill(player,info)
- if RunService:IsServer() then
- local char = player.Character
- local cf = char.HumanoidRootPart.CFrame
- local light = char.HumanoidRootPart:FindFirstChild('LightForm')
- local beam1 = Beam:Clone()
- local beam2 = Beam2:Clone()
- beam1.Beam.Attachment0 = beam1.Attachment
- beam1.Beam.Attachment1 = beam2.Attachment
- if light then
- for i,particle in pairs(light:GetDescendants()) do
- if particle:IsA('ParticleEmitter') then
- particle.Enabled = true
- end
- end
- wait(0.3)
- local Anchored = {}
- for i,part in pairs(char:GetDescendants()) do
- if part:IsA('BasePart') and part ~= light then
- if part.Anchored then Anchored[part] = true
- else
- part.Anchored = true
- part.Transparency = 1
- end
- end
- end
- local Effect = TweenService:Create(char.HumanoidRootPart,Info.FlyEffect,{CFrame=cf+Vector3.new(0,40,0)})
- Effect:Play()
- wait(1)
- beam1.Parent = workspace
- beam2.Parent = workspace
- beam1.CFrame = char.HumanoidRootPart.CFrame
- beam2.CFrame = cf
- spawn(function()
- for i = 1,30 do
- local hit = Events.RequireInputListen:InvokeClient(player,'Mouse.Hit')
- beam2.CFrame = hit
- local explosion = Explosion:Clone()
- explosion.CFrame = hit+Vector3.new(0,1,0)
- explosion.Parent = workspace
- Debris:AddItem(explosion,0.7)
- wait(0.125)
- end
- Debris:AddItem(beam1,0)
- Debris:AddItem(beam2,0)
- end)
- wait(5)
- local Effect = TweenService:Create(char.HumanoidRootPart,Info.FlyEffect,{CFrame=cf})
- Effect:Play()
- Effect.Completed:Wait()
- for i,part in pairs(char:GetDescendants()) do
- if part:IsA('BasePart') then
- if not Anchored[part] then
- part.Anchored = false
- part.Transparency = 0
- end
- end
- end
- for i,particle in pairs(light:GetDescendants()) do
- if particle:IsA('ParticleEmitter') then
- particle.Enabled = false
- end
- end
- end
- elseif RunService:IsClient() then
- local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
- local cf = workspace.CurrentCamera.CFrame
- workspace.CurrentCamera.CFrame = cf * shakeCFrame
- end)
- camShake:Start()
- wait(1)
- -- Explosion shake:
- for i = 1,10 do
- camShake:Shake(CameraShaker.Presets.Earthquake)
- wait(0.125)
- end
- end
- return true
- end
- if RunService:IsServer() then
- Info.FlyEffect = TweenInfo.new(1,Enum.EasingStyle.Linear)
- module.Requirements = {RequiredInputListeners={Enum.UserInputType.MouseButton1};
- RequireInputListener=true;
- RequireClientRender=true;
- RequireServerRender=true;
- RequiredInfo={'Mouse.Hit'}};
- function module.createAbilityManager()
- local manager = {Players={}}
- manager.__index = manager
- function manager:CallSkill(player,info)
- if not manager.Players[player] then
- manager.Players[player] = true
- local waitForClientRender
- local waitForServerRender
- if module.Requirements.RequireClientRender then
- spawn(function()
- waitForClientRender = Events.RequireSkill:InvokeClient(player,script.Name,info)
- end)
- else
- waitForClientRender = true
- end
- if module.Requirements.RequireServerRender then
- waitForServerRender = renderSkill(player,info)
- else
- waitForServerRender = true
- end
- repeat wait() until waitForServerRender and waitForClientRender
- manager.Players[player] = nil
- end
- end
- return setmetatable(manager,module)
- end
- elseif RunService:IsClient() then
- function module.renderSkill(info)
- renderSkill(info)
- end
- end
- return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement