Hey, I have been working on a combat system that has air combat sadly my air combat still has a few bugs and isn’t fully optimised this is my code →
task.spawn(function()
if string.len(Seq) == 3 and canAir == true then
local weld = Instance.new("ManualWeld")
weld.Part0 = ehumanoidRP
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
weld.Name = "canAir"
local vel = Instance.new("BodyVelocity",Humrp)
vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
vel.Velocity = Humrp.CFrame.upVector * 40
game.Debris:AddItem(vel,.2)
wait(.2)
Humrp.Anchored = true
delay(1,function()
weld:Destroy()
Humrp.Anchored = false
end)
elseif string.len(Seq) == 4 and canAir == true then
ehumanoidRP:WaitForChild("canAir"):Destroy()
Humrp.Anchored = false
local Evel = Instance.new("BodyVelocity",ehumanoidRP)
Evel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
Evel.Velocity = Humrp.CFrame.lookVector * 50 + Vector3.new(0,-20,0)
game.Debris:AddItem(Evel,.2)
ehumanoid.StateChanged:Connect(function(old,new)
if (old == Enum.HumanoidStateType.Freefall) or (new == Enum.HumanoidStateType.Landed)then
game.ReplicatedStorage.Camera.Explosion:FireClient(Player)
coroutine.wrap(function()
for _, plr in pairs(game.Players:GetChildren())do
game.ReplicatedStorage.RocksVFX:FireClient(plr,ehumanoidRP,3.5,20,1)
end
end)()
end
end)
end
end)
It works “fine” but it has some bugs they are
- If enemy dies you die to
- Sometimes doesn’t show to some players
- The Ground Throw is very bugy
- It fires the event everytime the enemy jumps