local path1 = Vector3.new(1,0,0.1)
local path2 = Vector3.new(1,0,0.2)
local path3 = Vector3.new(1,0,0.4)
local path4 = Vector3.new(1,0,0.8)
local path5 = Vector3.new(1,0,1)
local path6 = Vector3.new(1,0,1,1)
local path7 = Vector3.new(1,0,1.2)
local path8 = Vector3.new(1,0,1.4)
local path9 = Vector3.new(1,0,1.8)
local randompath
local debounce1 = false
function randompathchoose()
math.randomseed(tick()%1*1e6)
local choose = math.random(1,9)
if not debounce1 then debounce1 = true
if choose == 1 then
randompath = path1
elseif choose == 2 then
randompath = path2
elseif choose == 3 then
randompath = path3
elseif choose == 4 then
randompath = path4
elseif choose == 5 then
randompath = path5
elseif choose == 6 then
randompath = path6
elseif choose == 7 then
randompath = path7
elseif choose == 8 then
randompath = path8
elseif choose == 9 then
randompath = path9
end
end
end
function removestorm()
wait(45)
script.Parent:Destroy()
end
-----------------------------------
local debounce2 = false
local randomizedsize
function spawnpartmanager()
local copied
local size1 = Vector3.new(1,1,1)
local size2 = Vector3.new(1,1,2)
local size3 = Vector3.new(1,2,2)
local size4 = Vector3.new(2,2,2)
local size5 = Vector3.new(1,3,1)
local size6 = Vector3.new(1,4,1)
if not debounce2 then debounce2 = true
local parts = game.ServerStorage.BuildingParts:GetChildren()
for i = 1,1 do
wait(0.1)
if parts[i] and parts[i]:IsA("BasePart") then
local b = math.random(#parts)
local randomchoice = parts[b]
local copy = randomchoice:Clone()
copy.Parent = game.Workspace
copy.Position = script.Parent.PrimaryPart.Position
copied = copy
end
end
end
math.randomseed(tick()%1*1e6)
local choose = math.random(1,6)
if choose == 1 then
copied.Size = size1
elseif choose == 2 then
copied.Size = size2
elseif choose == 3 then
copied.Size = size3
elseif choose == 4 then
copied.Size = size4
elseif choose == 5 then
copied.Size = size5
elseif choose == 6 then
copied.Size = size6
end
wait(5)
debounce2 = false
end
---------------------------------------
randompathchoose()
removestorm()
wait(0.1)
while true do
wait()
print("test print")
script.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.PrimaryPart.Position + randompath))
spawnpartmanager()
end
in a nutshell, the while true do loop at the bottom wont run. it prints “test print” once then stops completely. why does it do this?