local db = false -- Personal creep stats -- local slashanim = script.slashanim local…
- User
local db = false
-- Personal creep stats --
local slashanim = script.slashanim local atkspeed = 70/50 local dps = math.random(19, 23)
local pathfindingService = game:GetService("PathfindingService") local creepsattackrange = 20 local targetCreepListDire = {} local targetCreepListRadiant = {} local waypoints = {} local dfws = 10 local fighting = false
local function attackCreep(creep, enemycreep) if enemycreep.Humanoid.Health > 0 and creep.Humanoid.Health > 0 then fighting = true waypoints = {} creep.Humanoid:MoveTo(enemycreep.HumanoidRootPart.Position) if (creep.HumanoidRootPart.Position - enemycreep.HumanoidRootPart.Position).Magnitude <= 3.5 then creep.Humanoid.WalkSpeed = dfws / 2.5 if db == false then db = true creep.Head.Slash:Play() if slashanim.Value == 1 then creep.Humanoid:LoadAnimation(script.Slash1):Play() slashanim.Value = 2 elseif slashanim.Value == 2 then creep.Humanoid:LoadAnimation(script.Slash2):Play() slashanim.Value = 1 end if math.random(0,enemycreep.MissChance.Value) <= enemycreep.MissChance.Value / 25 then if enemycreep:FindFirstChild("invincibility").Value == false then enemycreep.Humanoid:TakeDamage(dps) end wait(atkspeed) db = false end end else creep.Humanoid.WalkSpeed = dfws end if enemycreep.Humanoid.Health <= 0 then local cs = script:Clone() cs.Parent = script.Parent for i, v in pairs(creep.Humanoid.Animator:GetPlayingAnimationTracks()) do if v.Name == "Slash1" or v.Name == "Slash2" then v:Stop() end end script:Destroy() end else return end end
local function attackTower(creep, tower) if tower.Faction.Value ~= creep.Faction.Value then if tower.Health.Value > 0 and creep.Humanoid.Health > 0 then fighting = true waypoints = {} creep.Humanoid:MoveTo(tower.BasePart.Position) if (creep.HumanoidRootPart.Position - tower.BasePart.Position).Magnitude <= 7 then creep.Humanoid.WalkSpeed = dfws / 2.5 if db == false then db = true creep.Head.Slash:Play() if slashanim.Value == 1 then creep.Humanoid:LoadAnimation(script.Slash1):Play() slashanim.Value = 2 elseif slashanim.Value == 2 then creep.Humanoid:LoadAnimation(script.Slash2):Play() slashanim.Value = 1 end if tower:FindFirstChild("invincibility").Value == false then tower.Health.Value = tower.Health.Value - (dps / 1.2) end wait(atkspeed) db = false end
else creep.Humanoid.WalkSpeed = dfws end if tower.Health.Value <= 0 then local cs = script:Clone() cs.Parent = script.Parent for i, v in pairs(creep.Humanoid.Animator:GetPlayingAnimationTracks()) do if v.Name == "Slash1" or v.Name == "Slash2" then v:Stop() end end script:Destroy() end else return end endend
local function Lane(creep, targetCreepList, enemyThrone, enemyTowers) while creep.Humanoid.Health > 0 and fighting == false do if fighting == false then creep.Humanoid.WalkSpeed = dfws local path = pathfindingService:CreatePath() path:ComputeAsync(creep.PrimaryPart.Position, enemyThrone.Position)
waypoints = path:GetWaypoints() for i, waypoint in ipairs(waypoints) do creep.Humanoid:MoveTo(waypoint.Position) creep.Humanoid.MoveToFinished:Wait() end wait() else waypoints = {} end end - Assistant