Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Controllable Wave Hunter Script (severSided)
- local replicatedStorage = game:GetService("ReplicatedStorage")
- local serverPartsFolder = replicatedStorage.ServerParts
- local tool = script.Parent.Parent
- local effectFolder = tool.Effects
- local effects = effectFolder.E
- local serverParts = serverPartsFolder.Water.E
- local tweenService = game:GetService("TweenService")
- local workspaceFolder = workspace:WaitForChild("ServerEffectStorage")
- local runService = game:GetService("RunService")
- canBeUsed = false
- globalDragon = nil
- globalDuration = nil
- debugcd = false
- effects.RemoteEvents.Hold.OnServerEvent:Connect(function(plr, localCFrame)
- print(localCFrame)
- canBeUsed = true
- wait(.5)
- local particlesPart = serverParts:WaitForChild("The Wave Hunter"):Clone()
- particlesPart.Parent = plr.Character
- particlesPart.CFrame = plr.Character:WaitForChild("HumanoidRootPart").CFrame
- particlesPart.Orientation = Vector3.new(0,180,0)
- globalDragon = particlesPart
- local weld = Instance.new("WeldConstraint")
- weld.Part0 = plr.Character:WaitForChild("HumanoidRootPart")
- weld.Part1 = particlesPart
- weld.Parent = particlesPart
- local creationSound = effects:WaitForChild("Sounds"):WaitForChild("Wave Hunter"):Clone()
- creationSound.Parent = plr.Character.HumanoidRootPart
- creationSound:Play()
- local chargeSound = effects:WaitForChild("Sounds"):WaitForChild("Charge"):Clone()
- chargeSound.Parent = plr.Character.HumanoidRootPart
- chargeSound:Play()
- end)
- effects.RemoteEvents.Dive.OnServerEvent:Connect(function(plr, localCFrame)
- local function Bezier(t, P0, P1, P2)
- local point = (1-t)^2 * P0 + 2 * (1-t) * t * P1 + t^2 * P2
- return point
- end
- local function PerformDive(targetCframe)
- local startPos = plr.Character.HumanoidRootPart.Position
- local controlPoint = (startPos + targetCframe) / 2 + Vector3.new(0, 600, 0)
- local endPos = targetCframe
- local duration = 1.1
- globalDuration = duration
- local elapsedTime = 0
- local connection
- connection = game:GetService("RunService").Heartbeat:Connect(function(dt)
- elapsedTime = elapsedTime + dt
- local t = elapsedTime / duration
- if t > 1 then t = 1 end
- if t >= 1 then
- connection:Disconnect()
- plr.Character.HumanoidRootPart.Anchored = false
- plr.Character.Humanoid.WalkSpeed = plr.Character.Humanoid.WalkSpeed * 2
- end
- if t < 1 then
- local newPosition = Bezier(t, startPos, controlPoint, endPos)
- plr.Character.HumanoidRootPart.CFrame = CFrame.new(newPosition, endPos)
- end
- end)
- end
- PerformDive(localCFrame.Position + Vector3.new(0,10,0))
- task.delay(globalDuration, function()
- local explosionSound = effects:WaitForChild("Sounds"):WaitForChild("Explode"):Clone()
- explosionSound.Parent = plr.Character.HumanoidRootPart
- explosionSound:Play()
- local playerPos = plr.Character.HumanoidRootPart.Position
- local outlinerModel = serverParts:WaitForChild("WaterOutliner"):Clone()
- outlinerModel.Parent = workspace
- outlinerModel.Parent = workspaceFolder
- outlinerModel.SkullFacePlayer.Size /= 100
- outlinerModel:MoveTo(playerPos)
- local splashSound = effects.Sounds.SplashMaximum:Clone()
- splashSound.Parent = outlinerModel.PrimaryPart
- splashSound:Play()
- for _, particleEmitter in pairs(outlinerModel:GetDescendants()) do
- if particleEmitter:IsA("ParticleEmitter") then
- local originalSequence = particleEmitter.Size
- local newKeypoints = {}
- for _, keypoint in ipairs(originalSequence.Keypoints) do
- table.insert(newKeypoints, NumberSequenceKeypoint.new(keypoint.Time, keypoint.Value * 3, keypoint.Envelope * 3))
- end
- particleEmitter.Size = NumberSequence.new(newKeypoints)
- end
- end
- for _, mesh in pairs(outlinerModel:GetChildren()) do
- local increaseSizeTween = game.TweenService:Create(mesh, TweenInfo.new(5), {Size = mesh.Size * 3000, Transparency = 1})
- increaseSizeTween:Play()
- increaseSizeTween.Completed:Connect(function()
- if mesh:FindFirstChildOfClass("ParticleEmitter") then
- for _, particle in pairs(mesh:GetChildren()) do
- if particle:IsA("ParticleEmitter") then
- particle.Enabled = false
- task.delay(7, function()
- mesh:Destroy()
- end)
- end
- end
- end
- end)
- end
- end)
- task.delay(globalDuration, function()
- local dragonTween = game.TweenService:Create(globalDragon, TweenInfo.new(5), {Position = globalDragon.Position - Vector3.new(0, 100, 0)})
- dragonTween:Play()
- dragonTween.Completed:Connect(function()
- globalDragon:Destroy()
- end)
- end)
- task.delay(globalDuration, function()
- local humanoidRootPart = plr.Character.HumanoidRootPart
- local function endAttack()
- humanoidRootPart.Anchored = true
- humanoidRootPart.Velocity = Vector3.zero
- humanoidRootPart.AssemblyLinearVelocity = Vector3.zero
- wait(1)
- humanoidRootPart.Anchored = false
- end
- endAttack()
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement