-- Переменные для координат спавна крипов local radiantSpawnPoint = Vector3.new(133.165,…
- User
-- Переменные для координат спавна крипов local radiantSpawnPoint = Vector3.new(133.165, 0.5, 47.051) local direSpawnPoint = Vector3.new(-132.107, 0.5, 43.742)
local radiantModels = {} local direModels = {}
local function startFight(attacker, target) while attacker.Humanoid.Health > 0 and target.Humanoid.Health > 0 do attacker.Humanoid:MoveTo(target.PrimaryPart.Position) wait(0.6) -- Промежуток между атаками (можно настроить)
codeif (attacker.PrimaryPart.Position - target.PrimaryPart.Position).Magnitude <= 1.5 then -- Нанесение урона local damage = math.random(8, 12) -- Рандомное значение урона (можно настроить) target.Humanoid.Health = target.Humanoid.Health - damage else attacker.Humanoid:MoveTo(target.PrimaryPart.Position) end endend
local modelFolder = game.ServerStorage:WaitForChild("Creeps")
-- Получаем список моделей крипов и разделяем их по фракциям for _, model in ipairs(modelFolder:GetChildren()) do if model.Name:find("RadiantCreep") then table.insert(radiantModels, model) elseif model.Name:find("DireCreep") then table.insert(direModels, model) end end
local pathfindingService = game:GetService("PathfindingService")
local function spawnCreeps() -- Спавн радиантских крипов for _, model in ipairs(radiantModels) do local factionValue = Instance.new("StringValue") factionValue.Name = "Faction" factionValue.Value = "Radiant"
code - Assistant