In short
An object cannot be inside itself. The message names both: Attempt to set parent of Workspace.House to Workspace.House.Door means you tried to move House into Door, but Door is already inside House. Usually the two names are the wrong way round (door.Parent = house was meant), or a child has to be moved out before its old parent can go inside it.
What the message means
ServerScriptService.Builder:6: Attempt to set parent of Workspace.House to Workspace.House.Door would result in circular reference
The first name is the object whose Parent you set, the second is the new parent. If the second name starts with the first, the new parent is inside the object you are moving.
Roblox refuses the change and leaves both objects where they were.
Causes and fixes
Three things cause this error in practice. Each one below has the smallest code that triggers it, then the fix.
- The two objects are the wrong way round
- Swapping which object holds the other
- An object is parented to itself
The two objects are the wrong way round
Writing house.Parent = door when you meant to put the door into the house, often after renaming variables.
local house = workspace:WaitForChild("House")
local door = house:WaitForChild("Door")
-- Attempt to set parent of Workspace.House to Workspace.House.Door
-- would result in circular reference
house.Parent = door
Set the Parent of the object that should end up inside.
local ServerStorage = game:GetService("ServerStorage")
local house = workspace:WaitForChild("House")
local newDoor = ServerStorage:WaitForChild("Door"):Clone()
newDoor.Parent = house
Swapping which object holds the other
To turn "Folder A holds B" into "B holds A", moving A into B first fails, because B is still inside A at that moment.
local outer = workspace:WaitForChild("Outer")
local inner = outer:WaitForChild("Inner")
-- inner is still inside outer here
outer.Parent = inner
Move the inner object out first, then put the outer one inside it.
local outer = workspace:WaitForChild("Outer")
local inner = outer:WaitForChild("Inner")
inner.Parent = workspace
outer.Parent = inner
An object is parented to itself
A loop or a helper that receives the same object twice ends up writing x.Parent = x.
local function moveInto(item: Instance, target: Instance)
item.Parent = target
end
local crate = workspace:WaitForChild("Crate")
-- the same object passed twice
moveInto(crate, crate)
Check that the target is not the item and not inside it before moving.
local function moveInto(item: Instance, target: Instance): boolean
if target == item or target:IsDescendantOf(item) then
warn("Cannot move", item:GetFullName(), "into", target:GetFullName())
return false
end
item.Parent = target
return true
end
local crate = workspace:WaitForChild("Crate")
moveInto(crate, workspace)
Fix it in your place
Paste the error, RoCode fixes it in your place
Copy the line from Output and paste it here. RoCode opens the script it names in the place you have open in Studio, works out which of the causes above it is, and edits the code there instead of handing you a snippet to paste.
RoCode is an AI agent for Roblox Studio: it reads the scripts in the place you have open, finds the line and edits it there, and every change is an undo point. It runs on Windows or macOS with a desktop browser. Free to start, with free credits every day.
How to find the line that causes it
- Open Output (Window menu, or the Script tab), clear it with Ctrl+K (⌘K on Mac), and press Play.
- Find the first red line. It starts with the script's place in the Explorer and the line number, such as
ServerScriptService.Shop:12:. - Click the red line. Studio opens that script with the cursor on the failing line.
- Read the lines between
Stack BeginandStack Endunder it: they list the calls that led there, newest first, so you can see which function called the broken one. - Still not sure which value is wrong? Add
print(typeof(x), x)just above the line, or set a breakpoint on it and read the values in the Watch window.
Questions
How do I read the two names?
The first is the object you moved, the second is where you tried to put it. The second one is already inside the first.
Does this happen with Clone?
Not with the clone itself: a clone starts with no parent, so you can put it anywhere, even inside the original.
Did my objects change?
No. Roblox rejects the change, so both objects stay where they were and the script stops at that line.
Can RoCode fix it?
Yes. Paste the Output line into RoCode. It reads the script in your open place and fixes the order of the Parent changes.
Sources and further reading
How the code was checked: every block marked Fixed passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 12 November 2026), and every block marked Breaks compiles and fails only when it runs. The message wording was checked against the message format strings in Roblox Studio itself (macOS build installed on 12 November 2026) on 12 November 2026. A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.