You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to be able to create 1 folder for every part.ClassName that is in the workspace.
And when a new part is created it creates a folder once with that parts class name
- What is the issue? Include screenshots / videos if possible!
I’m not sure how to check if a folder with that parts classname already exists or when a parts is added that a folder with that parts classname exist
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
No one was able to help and nothing on the dev hub or discord / youtube.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
for Number, Instance1 in pairs(workspace:GetDescendants()) do
Boolean, Nil = pcall(function()
if Boolean then
local FindFirstChildOfClass = workspace:FindFirstChildOfClass("Folder")
if not FindFirstChildOfClass then
local Folder = Instance.new("Folder")
Folder.Name = Instance1.ClassName
Folder.Parent = workspace
if FindFirstChildOfClass.Name == Instance1.ClassName then
print("Gots")
end
end
elseif Nil ~= nil then
warn(Nil)
end
end)
end
workspace.ChildAdded:Connect(function(ChildAdded)
for i, v in pairs(workspace:GetChildren()) do
if not workspace[v.ClassName] then
local Folder = Instance.new("Folder")
Folder.Name = ChildAdded.ClassName
Folder.Parent = workspace
ChildAdded.Parent = Folder
else
ChildAdded.Parent = workspace[ChildAdded.ClassName]
end
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
This is my problem I hope some of you can do something to help.