#guys i need help why my npcs is killing each other but not the player first

1 messages · Page 1 of 1 (latest)

sage glen
ocean vessel
sage glen
ocean vessel
#

uhh there is multiply script because i got them from enemy npc with sword.. do i need to show all the scripts?

ocean vessel
sage glen
#

nvm i give up, please dont use free models dude

ocean vessel
#

sorry. my scripting skills are just bad and i cant script.. i just want to create the game that i can play with my friends

brittle inletBOT
#

studio** You are now Level 1! **studio

ocean vessel
#

@zinc breach

#

@zinc breach i hope you will help me crying

ocean vessel
ocean vessel
#
function findNearestTorso(pos)
    local list = game.Workspace:GetChildren()
    local torso = nil
    local dist = 10000
    local temp = nil
    local human = nil
    local temp2 = nil
    for x = 1, #list do
        temp2 = list[x]
        if (temp2.className == "Model") and (temp2 ~= script.Parent) then
            temp = temp2:findFirstChild("HumanoidRootPart")
            human = temp2:findFirstChild("Humanoid")
            if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
                if (temp.Position - pos).magnitude < dist then
                    torso = temp
                    dist = (temp.Position - pos).magnitude
                end
            end
        end
    end
    return torso
end

while true do
    wait(0.001)
    local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
    if target ~= nil then
        script.Parent.Humanoid:MoveTo(target.Position, target)
    end

end
#

this is follow script

#
while true do script.Parent.ClassicSword:Activate() task.wait(2) end
#

this is swordActivate script