This commit is contained in:
Leshyi committed 2026-11-29 22:26:59 +05:00
1 parent 11d5404f8f
commit f073f06427
3 files changed
+27 -24

No files matched your search

BIN
View File
Binary file not shown.
+3 -2
View File
@@ -214,7 +214,8 @@ function Objectives.start(config: Config): Match
local c = p.Character
local h = c and c:FindFirstChildOfClass("Humanoid")
local r = c and c:FindFirstChild("HumanoidRootPart")
if side and h and h.Health > 0 and r and r:IsA("BasePart") and p:GetAttribute("InArena") == true then
if side and h and h.Health > 0 and r and r:IsA("BasePart") and p:GetAttribute("InArena") == true
and p:GetAttribute("ArenaWaiting") ~= true then
table.insert(found, {player = p, side = side, root = r})
end
end
@@ -572,7 +573,7 @@ function Objectives.start(config: Config): Match
lifeActive, lifeEnds = true, now + 45
status("Мини-раунд " .. miniNumber)
elseif not b or not o then
status("Ожидаем игроков с обеих сторон")
status("Ждём игроков в обеих командах")
else
status("Следующий мини-раунд через " .. math.ceil(nextMini - now) .. " с")
end
+24 -22
View File
@@ -158,10 +158,14 @@ local function clearTools(container: Instance?)
end
local function guardInventory(player: Player, container: Instance)
local function disarmed(): boolean
return player:GetAttribute("InArena") ~= true or player:GetAttribute("ArenaWaiting") == true
or player:GetAttribute("ArenaIntermission") == true
end
container.ChildAdded:Connect(function(child)
if player:GetAttribute("InArena") ~= true and child:IsA("Tool") then child:Destroy() end
if child:IsA("Tool") and disarmed() then child:Destroy() end
end)
if player:GetAttribute("InArena") ~= true then clearTools(container) end
if disarmed() then clearTools(container) end
end
local function resetStreak(player: Player)
@@ -190,12 +194,6 @@ local function moveToLobby(player: Player)
end
end
local function bench(player: Player)
if not roster[player] then return end
player:SetAttribute("ArenaWaiting", true)
moveToLobby(player)
end
local function sendToLobby(player: Player)
roster[player] = nil
joinOrder[player] = nil
@@ -243,12 +241,24 @@ end
local function stageOnArena(player: Player)
placedCharacter[player] = nil
player:SetAttribute("InArena", true)
player.RespawnLocation = destinationFor(player)
local destination = destinationFor(player)
player.RespawnLocation = destination
local character = player.Character
clearTools(character)
clearTools(player:FindFirstChildOfClass("Backpack"))
clearTools(player:FindFirstChild("StarterGear"))
return character
return character, destination
end
local function bench(player: Player)
if not roster[player] then return end
player:SetAttribute("ArenaWaiting", true)
local character, destination = stageOnArena(player)
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if character and humanoid and humanoid.Health > 0 then
humanoid.Health = humanoid.MaxHealth
ArenaSpawns.place(character, destination)
end
end
local function enterRound(player: Player, match: Match)
@@ -283,7 +293,9 @@ local function onCharacter(player: Player, character: Model)
end)
if roster[player] and player:GetAttribute("InArena") == true then
if player:GetAttribute("ArenaIntermission") == true or player:GetAttribute("ArenaWaiting") == true then
ArenaSpawns.place(character, destinationFor(player))
local destination = player.RespawnLocation or destinationFor(player)
player.RespawnLocation = destination
ArenaSpawns.place(character, destination)
else
enterArena(player, character, humanoid)
end
@@ -554,18 +566,8 @@ local function returnVoters(match: Match)
balanceWaiting(match)
for _, player in returning do
if match.rule == "OneLife" then
player:SetAttribute("ArenaWaiting", true)
local character = stageOnArena(player)
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if character and humanoid and humanoid.Health > 0 then
humanoid.Health = humanoid.MaxHealth
ArenaSpawns.place(character, destinationFor(player))
end
else
deploy(player)
end
player:SetAttribute("ArenaIntermission", nil)
enterRound(player, match)
end
end