Помогите со скриптом Roblox Studio [Lua] Скрипт про голосование за карту. Нужно добавить…
- User
Помогите со скриптом Roblox Studio [Lua] Скрипт про голосование за карту. Нужно добавить чтобы после смерти игрока скрипт не начинал идти заново. Помогите пожалуйста cкрипт:
local rs = game.ReplicatedStorage
local maps = rs:WaitForChild("Maps")
local res = rs:WaitForChild("RemoteEvents")local numMapsVoting = 3
local intermissionTime = 6
local voteTime = 11
local roundDuration = 21 -- Длительность раунда в секундахlocal plrVotes = {}
function addVote(plr:Player, mapName:string)
plrVotes[plr] = mapName
res:WaitForChild("Voted"):FireAllClients(plrVotes)
endfunction removePlayerVote(plr:Player)
plrVotes[plr] = nil
res:WaitForChild("Voted"):FireAllClients(plrVotes)
endfunction loadMap(mapName:string)
local newMap = maps[mapName]:Clone()
newMap.Parent = workspacecodelocal spawns = newMap:WaitForChild("Spawns"):GetChildren() for i, plr in pairs(game.Players:GetPlayers()) do if plr.Character then plr.Character.HumanoidRootPart.CFrame = (spawns[i] and spawns[i].CFrame or spawns[i-#spawns]) + Vector3.new (0, 10, 0) end end return newMapend
function removeMap(map:Instance)
map:Destroy()codefor _, plr in pairs(game.Players:GetPlayers()) do plr:LoadCharacter() endend
function handleRound()
local plrsAlive = {}
for _, plr in pairs(game.Players:GetPlayers()) do
if plr.Character and plr.Character.Humanoid.Health > 0 then
table.insert(plrsAlive, plr)codeplr.Character.Humanoid.Died:Connect(function() table.remove(plrsAlive, table.find(plrsAlive, plr)) end) end end for i = 1, roundDuration do task.wait(1) if #plrsAlive == 0 then break end endend
res:WaitForChild("Voted").OnServerEvent:Connect(addVote)
game.Players.PlayerRemoving:Connect(removePlayerVote)
- Assistant