✓ Accepted answer
Properties, events, methods precede children.
So if you have a child with the same name as one of the three, you will be accessing the property/event/method instead.
Instance:Remove is a deprecated roblox function. It isn't completely gone though, you can still use it, though it is encouraged to avoid deprecated items.
Remember that
object:method(...)
Is just syntactic sugar (a nicer way to write something) for this:
object.method(object, ...)
You can index for a function without calling it aswell.
local random = math.random;
print(random(5, 10));
local part = Instance.new("Part");
part.BrickColor = BrickColor.new("Really red");
part.Parent = game:GetService("Workspace");
local part2 = Instance.new("Part");
part2.Parent = part.Parent;
part.Clone(part2).Parent = part.Parent;
Basically, Lua thought you were trying to index for the Remove function.
The solution is to rename it to something like Delete, but anything that is not "reserved."
4 comments
Rebirtho lmao now i tihnk of it i hate this name
I put the code into a code block.
It's because removed is a reserved value for the Remove() function just like other Functions and Properties.
For example let's say you have a Text box that you want Player Names to be inputted into if you call that Textbox "Name" you cannot index it as it's a reserved value for the purpose of the property "Name".
Hopefully this made sense :)
It fit into a comment so why don't you post a comment