-
What do you want to achieve? I want this tool to be parented to the folder I created
-
What is the issue? This tool keeps being parented to workspace instead of the folder I created
-
What solutions have you tried so far? I’ve tried doing this PSA: Don’t use Instance.new() with parent argument - Updates / Announcements - DevForum | Roblox but it hasn’t solved anything. I also have tried changing the parent to workspace then to the folder
All I want is to make the Tool parent to the folder I created but it keeps parenting it to workspace.
function CreateItemFolder(player, itemName, toolInfo)
local foundItemFolder = ItemsFolder:FindFirstChild(itemName)
if foundItemFolder then
local folder = Instance.new("Folder")
folder.Name = itemName
folder.Parent = workspace
local toolClone = foundItemFolder.Tool:Clone()
toolClone.Parent = folder
local Configuration = Instance.new("Configuration")
Configuration.Parent = folder
for property, value in pairs(toolInfo) do
if typeof(value) == "string" then
local newValue = Instance.new("StringValue", Configuration)
newValue.Name = property
newValue.Value = value
elseif typeof(value) == "number" then
local newValue = Instance.new("NumberValue", Configuration)
newValue.Name = property
newValue.Value = value
elseif typeof(value) == "boolean" then
local newValue = Instance.new("BoolValue", Configuration)
newValue.Name = property
newValue.Value = value
end
end
return folder
end
end
I just found out that it is a roblox bug not a bug in my code