Hello devs ! Am actually trying to remove all tools at the start of a round but that not working.
Someone can help me?
Script here :
local intermission = 25
local roundLength = 150
local inRound = game.ReplicatedStorage.InRound
local staus = game.ReplicatedStorage.Status
inRound.Changed:Connect(function()
if inRound.Value == false then
for i, plr in pairs(game.Players:GetChildren()) do
local char = plr.Character
local humanRoot = char:WaitForChild("HumanoidRootPart")
humanRoot.CFrame = game.Workspace.lobbySpawn.CFrame
game.Workspace.Legendary_Chest.Union:Destroy()
game.Workspace.Legendary_Chest.Part:Destroy()
game.Workspace.Legendary_Chest.Logo:Destroy()
game.Workspace.Legendary_Chest.Open:Destroy()
game.Workspace.Rare_Chest.Union:Destroy()
game.Workspace.Rare_Chest.Part:Destroy()
game.Workspace.Rare_Chest.Logo:Destroy()
game.Workspace.Rare_Chest.Open:Destroy()
game.Workspace.Epic_Chest.Union:Destroy()
game.Workspace.Epic_Chest.Part:Destroy()
game.Workspace.Epic_Chest.Logo:Destroy()
game.Workspace.Epic_Chest.Open:Destroy()
game.Workspace.Common_Chest.Union:Destroy()
game.Workspace.Common_Chest.Part:Destroy()
game.Workspace.Common_Chest.Logo:Destroy()
game.Workspace.Common_Chest.Open:Destroy()
end
end
end)
local function round()
while true do
local requiredPlayers = 2
repeat
wait(1)
staus.Value = " ".. requiredPlayers.." players needed to play."
until #game.Players:GetChildren() >= requiredPlayers
inRound.Value = false
for i = intermission, 0, -1 do
staus.Value = "Game will start in "..i.." seconds"
wait(1)
end
game.ReplicatedStorage.Boxs.Common:Clone().Parent = workspace
game.ReplicatedStorage.Boxs.Epic:Clone().Parent = workspace
game.ReplicatedStorage.Boxs.Legendary:Clone().Parent = workspace
game.ReplicatedStorage.Boxs.Rare:Clone().Parent = workspace
inRound.Value = true
wait(3)
for i = roundLength, 0, -1 do
wait(1)
staus.Value = "Game will end in "..i.." seconds"
local playing = {}
for i, plr in pairs(game.Players:GetChildren()) do
if plr.Team.Name == "Playing" then
table.insert(playing, plr.Name)
print("inserted player")
end
end
if #playing == 0 then
staus.Value = "Everyone Has Died"
wait(3)
break
en
end
end
end
spawn(round)
-Tnks for your help.