how i can get only one part in evre time loop done
while wait(10) do
for _,V in ipairs(workspace.PartDi:GetChildren()) do
if V:IsA("Part") then
print(V)
end
end
end```
how i can get only one part in evre time loop done
while wait(10) do
for _,V in ipairs(workspace.PartDi:GetChildren()) do
if V:IsA("Part") then
print(V)
end
end
end```
local CurrentPart -- to store the Part we want
-- for loop:
if V:IsA("BasePart") then -- if Object is a BasePart
CurrentPart = v -- Assigns Variable as Part
break -- Exits the for loop
end
However, If you want it to be randomized
local PartInfo = {} -- to Store the Data for Parts
if V:IsA("BasePart") then -- if Object is a BasePart
table.insert(PartInfo, V) -- Inserts Parts into table
end
CurrentPart = #PartInfo > 1 and PartInfo[math.random(1, #PartInfo)] or PartInfo[1]
-- Gets a Random Part from table
and if you really wanted to, you can simply remove all the Instances
that arent BaseParts