well When I play long my Game Stopped
(ServerScriptService.important script :3:16: attempt to index nil with 'CFrame')
This is the script
local roundLenght = 2
local intermissionLenght = 2
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local LobbySpawn = game.Workspace.LobbySpawn
local AvailableSpawnPoints = game.Workspace.SpawnPoints:GetChildren()
InRound.Changed:Connect(function()
if InRound.Value == true then
for _, player in pairs(game.Players:GetChildren())do
wait(0.02)
game.Lighting.Part1:clone().Parent = game.Workspace
local char = player.Character
char.HumanoidRootPart.CFrame = AvailableSpawnPoints[1].CFrame + Vector3.new(0,10,0)
table.remove(AvailableSpawnPoints,1)
wait(2)
game.Lighting.Blade:clone().Parent = player.Backpack
end
else
for _, player in pairs(game.Players:GetChildren())do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
wait(0.1)
game.Workspace.Part1:Remove()
wait(0.1)
game.Players:FindFirstChild("Blade", true):Remove()
end
end
end)
local function roundTimer()
while wait() do
for i = intermissionLenght, 1, -1 do
InRound.Value = false
wait(1)
Status.Value = "intermission: "..i.." seconds left! Get Ready to do an Icy Fight!"
end
for i = roundLenght, 1, -1 do
InRound.Value = true
wait(1)
Status.Value = "Game: "..i.." seconds left!"
end
end
end
spawn(roundTimer)
Can you help me? please thank you
