23
This commit is contained in:
1 parent
11d5404f8f
commit
f073f06427
3 files changed
+28
-25
No files matched your search
BIN
Binary file not shown.
@@ -214,7 +214,8 @@ function Objectives.start(config: Config): Match
|
|||||||
local c = p.Character
|
local c = p.Character
|
||||||
local h = c and c:FindFirstChildOfClass("Humanoid")
|
local h = c and c:FindFirstChildOfClass("Humanoid")
|
||||||
local r = c and c:FindFirstChild("HumanoidRootPart")
|
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})
|
table.insert(found, {player = p, side = side, root = r})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -556,7 +557,7 @@ function Objectives.start(config: Config): Match
|
|||||||
for _, p in members do config.bench(p) end
|
for _, p in members do config.bench(p) end
|
||||||
lifeActive, nextMini = false, now + 4
|
lifeActive, nextMini = false, now + 4
|
||||||
end
|
end
|
||||||
if now >= nextMini then config.balanceWaiting() end
|
if now >= nextMini then config.balanceWaiting() end
|
||||||
local ready: {Player} = {}
|
local ready: {Player} = {}
|
||||||
local b, o = false, false
|
local b, o = false, false
|
||||||
for _, p in members do
|
for _, p in members do
|
||||||
@@ -572,7 +573,7 @@ function Objectives.start(config: Config): Match
|
|||||||
lifeActive, lifeEnds = true, now + 45
|
lifeActive, lifeEnds = true, now + 45
|
||||||
status("Мини-раунд " .. miniNumber)
|
status("Мини-раунд " .. miniNumber)
|
||||||
elseif not b or not o then
|
elseif not b or not o then
|
||||||
status("Ожидаем игроков с обеих сторон")
|
status("Ждём игроков в обеих командах")
|
||||||
else
|
else
|
||||||
status("Следующий мини-раунд через " .. math.ceil(nextMini - now) .. " с")
|
status("Следующий мини-раунд через " .. math.ceil(nextMini - now) .. " с")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -158,10 +158,14 @@ local function clearTools(container: Instance?)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function guardInventory(player: Player, container: Instance)
|
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)
|
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)
|
end)
|
||||||
if player:GetAttribute("InArena") ~= true then clearTools(container) end
|
if disarmed() then clearTools(container) end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function resetStreak(player: Player)
|
local function resetStreak(player: Player)
|
||||||
@@ -190,12 +194,6 @@ local function moveToLobby(player: Player)
|
|||||||
end
|
end
|
||||||
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)
|
local function sendToLobby(player: Player)
|
||||||
roster[player] = nil
|
roster[player] = nil
|
||||||
joinOrder[player] = nil
|
joinOrder[player] = nil
|
||||||
@@ -243,12 +241,24 @@ end
|
|||||||
local function stageOnArena(player: Player)
|
local function stageOnArena(player: Player)
|
||||||
placedCharacter[player] = nil
|
placedCharacter[player] = nil
|
||||||
player:SetAttribute("InArena", true)
|
player:SetAttribute("InArena", true)
|
||||||
player.RespawnLocation = destinationFor(player)
|
local destination = destinationFor(player)
|
||||||
|
player.RespawnLocation = destination
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
clearTools(character)
|
clearTools(character)
|
||||||
clearTools(player:FindFirstChildOfClass("Backpack"))
|
clearTools(player:FindFirstChildOfClass("Backpack"))
|
||||||
clearTools(player:FindFirstChild("StarterGear"))
|
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
|
end
|
||||||
|
|
||||||
local function enterRound(player: Player, match: Match)
|
local function enterRound(player: Player, match: Match)
|
||||||
@@ -283,7 +293,9 @@ local function onCharacter(player: Player, character: Model)
|
|||||||
end)
|
end)
|
||||||
if roster[player] and player:GetAttribute("InArena") == true then
|
if roster[player] and player:GetAttribute("InArena") == true then
|
||||||
if player:GetAttribute("ArenaIntermission") == true or player:GetAttribute("ArenaWaiting") == 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
|
else
|
||||||
enterArena(player, character, humanoid)
|
enterArena(player, character, humanoid)
|
||||||
end
|
end
|
||||||
@@ -554,18 +566,8 @@ local function returnVoters(match: Match)
|
|||||||
|
|
||||||
balanceWaiting(match)
|
balanceWaiting(match)
|
||||||
for _, player in returning do
|
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)
|
player:SetAttribute("ArenaIntermission", nil)
|
||||||
|
enterRound(player, match)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user