We use cookies on this site to enhance your user experience

How Deprecation Affects Your Code

How Deprecation Affects Your Code

Aug 29 2019, 9:26 AM PST 2 min

Deprecation is a term for a property, method, class, or other item that is no longer meant to be used.

Why items are deprecated

Items are deprecated when they are no longer meant to be used for an assortment of reasons. Some examples are that the original method was a typo or does not look like other property and method names, such as Instance:className, Instance:children, or Instance:service. Other examples are when a newer alternative is available or a better way of doing something is created.

Why not to use deprecated items

Aside from the fact that Roblox discourages use of these items, they may be removed at any point (as you’re not supposed to be using them anyways)! This can cause code to break. Another reason is that newer, better methods may exist that will be updated while older methods will not. This means that it can be harder to code with deprecated items and easier to code with newer items.

What to do if your code uses deprecated items

In most cases, when Roblox deprecates something, they provide an alternative. For example, the old children method now has an alternative, Instance/GetChildren|Instance:GetChildren, which should be used instead. You can almost always simply replace the old method call with the new one and it will work. In other cases, it is harder to switch. You might have to rewrite functions or other parts of your code to get it to work.

  • coding
  • concept
  • lua