local RP = game:GetService("ReplicatedStorage")
local event = RP.Attack
local RockModule = require(game.ReplicatedStorage.Modules.RocksModule)
local function lerp_quadratic(p0, p1, p2, t)
return (1 - t)^2 * p0 + 2 * (1 - t) * t * p1 + t^2 * p2
end
local ts = game:GetService("TweenService")
local Shooting = workspace.Shooting
local function shoot(s, m, f, sphere)
local sc = Shooting:Clone()
sc.Parent = workspace
sc.CFrame = sphere.CFrame * CFrame.new(0, 0, 3)
sc.Effects.Sparks:Emit(20)
sc.ParticleEmitter:Emit(20)
wait(.12)
for i = 0, 75, 1 do
local t = i/75
local curve = lerp_quadratic(s.p,m.p,f,t)
ts:Create(sphere, TweenInfo.new(.3), {Position = curve}):Play()
task.wait(.001)
end
end
event.OnServerEvent:Connect(function(player, humrp, mousePos, cam, partPos)
local rp1 = RaycastParams.new()
rp1.IgnoreWater = true
rp1.FilterDescendantsInstances = {humrp.Parent:GetDescendants()}
rp1.FilterType = Enum.RaycastFilterType.Exclude
local player = game.Players:GetPlayerFromCharacter(humrp.Parent)
local start1 = humrp.CFrame * CFrame.new(0, 10, 0)
local start2 = humrp.CFrame * CFrame.new(10, 5, 0)
local start3 = humrp.CFrame * CFrame.new(-10, 5, 0)
local finish = (humrp.Position - Vector3.new(0, -5, 0)) + mousePos.lookVector * 150
local mid1 = humrp.CFrame * CFrame.new(0,0,(humrp.CFrame.lookVector * 10)) * CFrame.new(0, 22, 0)
local mid2 = humrp.CFrame * CFrame.new(0,0,(humrp.CFrame.lookVector * 10)) * CFrame.new(15, 17, 0)
local mid3 = humrp.CFrame * CFrame.new(0,0,(humrp.CFrame.lookVector * 10)) * CFrame.new(-15, 17, 0)
local BallAppear = workspace.BallAppear:Clone()
BallAppear.Parent = workspace
print(2)
local sphere1 = workspace.Ball:Clone()
sphere1.Parent = workspace.Clones
sphere1.CanTouch = true
sphere1.CanCollide = true
local sphere2 = workspace.Ball:Clone()
sphere2.Parent = workspace.Clones
sphere2.CanTouch = true
sphere2.CanCollide = true
local sphere3 = workspace.Ball:Clone()
sphere3.Parent = workspace.Clones
sphere3.CanTouch = true
sphere3.CanCollide = true
sphere1.CFrame = start1
BallAppear.CFrame = sphere1.CFrame
BallAppear.Effects.Slash:Emit(200)
BallAppear.Effects.Sparks:Emit(200)
BallAppear.ParticleEmitter:Emit(200)
wait(.7)
sphere2.CFrame = start2
BallAppear.CFrame = sphere2.CFrame
BallAppear.Effects.Slash:Emit(200)
BallAppear.Effects.Sparks:Emit(200)
BallAppear.ParticleEmitter:Emit(200)
wait(.7)
sphere3.CFrame = start3
BallAppear.CFrame = sphere3.CFrame
BallAppear.Effects.Slash:Emit(200)
BallAppear.Effects.Sparks:Emit(200)
BallAppear.ParticleEmitter:Emit(200)
wait(.7)
BallAppear:Destroy()
sphere1.Trail.Enabled = true
sphere2.Trail.Enabled = true
sphere3.Trail.Enabled = true
task.spawn(shoot, start1, mid1, finish, sphere1)
wait(.5)
task.spawn(shoot, start2, mid2, finish, sphere2)
wait(.5)
task.spawn(shoot, start3, mid3, finish, sphere3)
wait(.5)
end)
This is the full code,
here is a video, nothing in output