#How go up

1 messages · Page 1 of 1 (latest)

wet quartz
#
game.ReplicatedStorage.UppercutEvent.OnServerEvent:Connect(function(plr)
    spawn(function()
        plr.Character.Humanoid.WalkSpeed = 0
        task.wait(.25)
        plr.Character.Humanoid.WalkSpeed = 16
    end)
    
    local hitbox = Instance.new("Part")
    
    hitbox.Parent = workspace
    hitbox.CanCollide = false
    hitbox.Anchored = true
    hitbox.Size = Vector3.new(6,6,6)
    hitbox.BrickColor = BrickColor.new("Really red")
    hitbox.Transparency = .8
    hitbox.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-3)
    game.Debris:AddItem(hitbox,.5)
    
    
    
    
    
    
    local character = plr.Character
    local hitboxCooldown = false
    hitbox.Touched:Connect(function(hit)
        if hit.Parent.Name ~= plr.Name and hit.Parent:FindFirstChild("Humanoid") then
            if hitboxCooldown == true then return end
            hitboxCooldown = true

            hit.Parent:FindFirstChild("Humanoid"):TakeDamage(10)
            local target = hit.Parent:FindFirstChild("HumanoidRootPart")
            local BV = Instance.new("BodyVelocity")
            BV.P = math.huge
            BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
            BV.Velocity = character:FindFirstChild("HumanoidRootPart").CFrame.lookVector * 30
            BV.Parent = target
            game.Debris:AddItem(BV, 0.5)
            task.wait(1)
            hitboxCooldown = false

        end
    end)
    
end)

How would one make the Body Velocity knockback go up while still being based off the camera

gleaming pumice
#

game.ReplicatedStorage.UppercutEvent.OnServerEvent:Connect(function(plr, camLook)
-- brief root-lock (your code)
task.spawn(function()
local hum = plr.Character and plr.Character:FindFirstChildOfClass("Humanoid")
if hum then
local old = hum.WalkSpeed
hum.WalkSpeed = 0
task.wait(0.25)
hum.WalkSpeed = old
end
end)

-- hitbox (your code)
local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
if not root then return end

local hitbox = Instance.new("Part")
hitbox.Parent = workspace
hitbox.CanCollide = false
hitbox.Anchored = true
hitbox.Size = Vector3.new(6,6,6)
hitbox.BrickColor = BrickColor.new("Really red")
hitbox.Transparency = 0.8
hitbox.CFrame = root.CFrame * CFrame.new(0,0,-3)
game.Debris:AddItem(hitbox, 0.5)

-- build a knockback direct
#

If you want the camera’s pitch to matter too, don’t zero out Y. Instead:

local knockDir = (camLook + Vector3.new(0, 0.5, 0)).Unit

#

For a more “pop” feel, increase upBias or multiply by a bit more power just for Y:

local base = horiz.Unit
local knockDir = (Vector3.new(base.X, 0, base.Z) + Vector3.new(0, 1.1, 0)).Unit