#zombie attacked air and i got damaged

1 messages · Page 1 of 1 (latest)

drowsy elbow
lone wigeonBOT
#

studio** You are now Level 5! **studio

drowsy elbow
#

local animator = script.Parent:WaitForChild("Humanoid"):WaitForChild("Animator")

local attackanim = script:WaitForChild("attackanim")
local attackanimTrack = animator:LoadAnimation(attackanim)

local range = script.Parent:WaitForChild("range")
local vfx = script.Parent:WaitForChild("vfx"):WaitForChild("vfxparry")

local player = game:GetService("Players")
local mobs = game.Workspace:WaitForChild("currentmob"):GetChildren()

local playerhitted = {}

range.Touched:Connect(function(somethingtouchedrange)
if somethingtouchedrange.Parent:FindFirstChild("Humanoid") and player:GetPlayerFromCharacter(somethingtouchedrange.Parent) then

    if somethingtouchedrange.Parent:FindFirstChild("Humanoid").Health > 0 and not table.find(playerhitted, somethingtouchedrange.Parent) then
        table.insert(playerhitted, somethingtouchedrange.Parent)
        attackanimTrack:Play()
        attackanimTrack.Priority = Enum.AnimationPriority.Movement
        
        task.wait(10)
        table.clear(playerhitted, somethingtouchedrange.Parent)
    end
end

end)

attackanimTrack:GetMarkerReachedSignal("vfxparrystart"):Connect(function(vfxparryhasstarted)
if vfxparryhasstarted then
print("vfxparry started")
vfx:Emit(1)
end
end)

#

attackanimTrack:GetMarkerReachedSignal("punch1"):Connect(function(punch1hasstarted)
if punch1hasstarted then
print("hitbox script has started")
local zomcframe = script.Parent.HumanoidRootPart.CFrame * CFrame.new(Vector3.new(0, 0, -4))
local hitboxsize = Vector3.new(9, 9, 8)

    local hitbox = Instance.new("Part")
    hitbox.Anchored = true
    hitbox.CanCollide = false
    hitbox.CanQuery = false
    hitbox.CanTouch = false
    hitbox.Size = hitboxsize
    hitbox.CFrame = zomcframe
    hitbox.BrickColor = BrickColor.new("Really red")
    hitbox.Transparency = 0.75
    hitbox.Parent = workspace
    
    local params = OverlapParams.new()
    params.FilterDescendantsInstances = {hitbox, mobs}
    
    
    local somethingtouchedhitbox = workspace:GetPartBoundsInBox(zomcframe, hitboxsize, params)

    
    
    local hitchar = {}
    for i, part in pairs(somethingtouchedhitbox) do
        if part.Parent:FindFirstChildOfClass("Humanoid") and not table.find(hitchar, part.Parent) then
            table.insert(hitchar, part.Parent)
            print(part.Parent.Name)
            part.Parent:WaitForChild("Humanoid").Health -=10
            
            
            part.Parent:SetAttribute("stunned", true)
            print("set part parent stun to true")
            task.wait(2)
            part.Parent:SetAttribute("stunned", false)
            print("set part parent stun to false")
            
            --[[task.spawn(function()
                part.Parent:WaitForChild("Humanoid").WalkSpeed = 4
                task.wait(3)
                part.Parent:WaitForChild("Humanoid").WalkSpeed = 10
            end)]]
        end
    end

    task.delay(0.25, function()
        hitbox:Destroy()
        print("hitbox has been destroyed")
    end)    
end

end)

thin badger
#

Idk but in the video it did kinda toich you

drowsy elbow
fleet bay
#

seems normal, the zombie moved faster than you and it easily hit when you stopped moving

drowsy elbow
#

normally if the hitbox touches something it would destroy itself right away