ok, i recently just ran into a completely random thing, without no explanation, no errors in the output, out of nowhere. this while true loop stopped working, i tested that fact by printing a " loop started " if it did, but it just didn’t. is this roblox or is it just something wrong in my code?
The Script
local mapfolder = game.Lighting.Maps
local maps = mapfolder:GetChildren()
local roundtime = script.RoundTime
local musicFolder = game.Lighting.Music
local particlesFolder = game.Lighting.Particles
local lastmap
local particles
while true do
local chosenmap = maps[math.random(1,#maps)]
if chosenmap == lastmap then
repeat chosenmap = maps[math.random(1,#maps)] until chosenmap ~= lastmap
end
local currentmap = chosenmap:Clone()
currentmap.Parent = game.Workspace
currentmap:MakeJoints()
local music = musicFolder[chosenmap.Name]:Clone()
music.Parent = workspace
music:Play()
if particlesFolder:FindFirstChild(chosenmap.Name) ~= nil then
particles = particlesFolder[chosenmap.Name:GetChildren()]:Clone()
particles.Parent = workspace
end
for i,player in pairs(game:GetService("Players"):GetPlayers()) do
player:LoadCharacter()
end
wait(300)
lastmap = chosenmap
currentmap:Destroy()
music:Destroy()
particles:Destroy()
end
thanks for reading, please help!