#Humanoid not getting damage

1 messages · Page 1 of 1 (latest)

tawny jay
#

how can I make seal receive damage? Zombie gets it, but for some reason seal doesn't

I got seal model on toolbox, but added Humanoid, HumanoidRootPart and Motor6D

TowerTesting script:

local tower = script.Parent
local mobs = workspace.Grassland.Mob

local function FindNearestTarget()
    local maxDistance = 50
    local nearestTarget = nil

    for i, target in ipairs(mobs:GetChildren()) do
        local distance = (target.HumanoidRootPart.Position - tower.Position).Magnitude
        print(target.Name, distance)
        if distance < maxDistance then
            print(target.Name, "is the nearest target rn")
            nearestTarget = target
            maxDistance = distance
        end
    end
    
    return nearestTarget
end

while true do
    local target = FindNearestTarget()
    
    if target then
        target.Humanoid:TakeDamage(25)
    end
    
    task.wait(1)
end

-# P.S. I'm making this game using GnomeCode Tower Defense tutorials

soft laurel
#

cus its gnomecode

analog forge
#

yea gnomecode is a little liar

tawny jay
#

seal doesn't even show its display name (I didn't make it by his tutorial)

soft laurel
rare lotus
#

i would just print out the target name to even check if its an instance or anything at all