Roblox Engine API Expander v2

Roblox Engine API Expander v2

Overview

This is a completely reworked version of the original API expander I made some time ago, you can still find the old one in this thread.

Hello everyone! While developing on Roblox Studio, I stumbled upon an issue when trying to use methods in instances which I believed should be there by default, methods such as WaitForChildWhichIsA or GetChildrenOfClass. These methods don’t exist by default and I believe they should be there without any extra steps.

That’s why I decided to make this simple module. As its title says, it expands the methods provided by the Engine API, specifically methods that can be used on all kinds of instances, adding the methods mentioned before and more.

Features

  • WaitForChildWhichIsA method.
  • GetDescendantsWhichAre method.
  • GetDescendantsOfClass method.
  • GetChildrenOfClass method.
  • GetChildrenWhichAre method.
  • FindFirstSibling method.
  • IsSiblingOf method.
  • FindFirstSiblingWhichIsA method.
  • FindFirstSiblingOfClass method.
  • GetSiblings method.
  • .SiblingRemoved signal.
  • .SiblingAdded signal.

Now you can directly call methods from instances instead of having to pass the instance as a parameter:

local Instances = require(script.Parent.Parent)
local workspace = Instances:Register(workspace)
print(workspace:GetChildrenWhichAre("ModuleScript"))

The source code can be found open source on GitHub and can be simply imported into Roblox Studio using the following model .

Feel free to contribute by making a pull request in the GitHub repository.

Any feedback is appreciated, I hope this module is useful and solves the following issue.

24 Likes

these should be in the engine already, crazy how sometimes ppl gotta make new features themselves lol

16 Likes

I tried to make a pull request but I’m not familiar with GitHub so I’ll just mention it here.

I recently came across an engine feature request called ‘API to get humanoid from basepart’ and came up with these API ideas:

If you want, you can take this and incorporate it into your module since I think it ties in pretty well. :smile:

3 Likes

These two already exist in Roblox API

  • FindFirstChild(name,true)
  • GetDescendants()
3 Likes

I know but sometimes some methods get disabled for some reason, that’s why I provide an alternative if they are disabled. From what I know FindFirstDescendant is fully disabled now so FindFirstChild recursive should be used instead.

2 Likes

Thanks for the feedback, I’ll add it soon.

2 Likes

Update

Added Dependencies

  • Added GoodSignal for custom RBXScriptSignals.

Bug Fixes

  • Fixed bug when HTTP requests are disabled.

Added Methods

  • Added FindFirstSibing method.
  • Added IsSiblingOf method.
  • Added FindFirstSiblingWhichIsA method.
  • Added FindFirstSiblingOfClass method.
  • Added GetSiblings method.
2 Likes

It internally uses GetDescendants so it won’t work if GetDescendants gets disabled

image

image

1 Like

Mb, that was meant to call the GetDescendants function recursively. I should call GetChildren recursively instead.

1 Like

Not to mention, FindFirstDescendant is more of a wrapper of FindFirstChild

image

1 Like

Update

Added Examples

  • Added examples for .SiblingAdded and .SiblingRemoved.

Removed Methods

  • Removed FindFirstDescendant, use FindFirstChild recursively instead.
  • Removed GetDescendants
1 Like

Why would GetDescendants be disabled if it used widely by everyone?

FindFirstDescendant got deprecated and it was widely used by everyone :man_shrugging:

FindFirstDescendant was always disabled in the first place.

I don’t remember tho, I’ve used FindFirstDescendant in the past and it wasn’t disabled.

Always been disabled from the start. That’s not how versioning works if you think that GetDescendants will be removed. That’s like saying ffc will be removed because something is disabled.

And that is why I removed the GetDescendants function I made.

It is completely up to the user to use the latest version or the older version so I don’t see why it’s a problem, You aren’t being forced to use the latest version unless you are using a package which this model isn’t :person_shrugging:

1 Like

Awesome to see you added all the Sibling functions, and sorry I didn’t reply to your private message, I’ve only just noticed it.

If you wanted, you could add GetSiblingsOfClass & GetSiblingsWhichAre since you have them for Children and Descendants.

Also, there’s a typo with FindFirstSibling missing an L. It’s not in the code though, only your post and GitHub page.

1 Like

My bad, didn’t notice the Sibling part.

1 Like