local m=game.ReplicatedStorage.Sounds.NPC.Banto:GetChildren()banto.Health.Changed:connect(function()local W=m[math.random(1,#m)]:Clone()W.Parent=banto.PrimaryPart W.PlayOnRemove=true wait()W:Destroy()end)while true do bp.Parent=banto.PrimaryPart local m repeat local W=Ray.new(Vector3.new(origin.p.x+math.random(-tether,tether),banto.PrimaryPart.Position.Y+100,origin.p.z+math.random(-tether,tether)),Vector3.new(0,-130,0))local h,o,D,s=workspace:FindPartOnRay(W,banto)if h==workspace.Terrain and s~=Enum.Material.Water then m=o+Vector3.new(0,2.25,0)end wait()until m walk:Play()local W=banto.PrimaryPart.Position local h=CFrame.new(Vector3.new(W.X,0,W.Z),Vector3.new(m.X,0,m.Z))bg.CFrame=h bp.Position=(h*CFrame.new(0,0,-100)).p local o=tick()repeat wait(.5)local W=Ray.new(banto.PrimaryPart.Position,Vector3.new(0,-140,0))until(banto.PrimaryPart.Position-m).magnitude<10 or tick()-o>10 walk:Stop()bp.Parent=nil wait(math.random(3,8))end

local soundBank =  game.ReplicatedStorage.Sounds.NPC.Banto:GetChildren()
banto.Health.Changed:connect(function()
    local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
    hitSound.Parent = banto.PrimaryPart
    hitSound.PlayOnRemove = true
    wait()
    hitSound:Destroy()
end)

while true do
    bp.Parent = banto.PrimaryPart
    local goal
    repeat 
    local ray = Ray.new(Vector3.new(origin.p.x+math.random(-tether,tether), banto.PrimaryPart.Position.Y+100, origin.p.z+math.random(-tether,tether)),Vector3.new(0,-130,0))
    local part,pos,norm,mat = workspace:FindPartOnRay(ray,banto)
    if part == workspace.Terrain and mat ~= Enum.Material.Water then
        goal = pos+Vector3.new(0,2.25,0)
    end
    wait()
    until goal
    --Set new goal for banto to MoveTo :)
    walk:Play()
    local pos = banto.PrimaryPart.Position
    local cf = CFrame.new(Vector3.new(pos.X, 0, pos.Z), Vector3.new(goal.X, 0, goal.Z))
    bg.CFrame = cf
    bp.Position = (cf*CFrame.new(0,0,-100)).p
    
    local start = tick()
    repeat wait(.5)
    local ray = Ray.new(banto.PrimaryPart.Position, Vector3.new(0,-140,0))
    
    until (banto.PrimaryPart.Position-goal).magnitude < 10 or tick()-start >10
    walk:Stop()
    bp.Parent = nil
    wait(math.random(3,8))
end
