("WaitForChild","Blah") stopped working

I want to use (“WaitForChild”,“Blah”) to waitforchild this worked up until this morning when I started getting the error, “attempt to call a userdata value”, on this line:
require(player("WaitForChild","PlayerGui")("WaitForChild","Modules"("WaitForChild","safeSystem")):loadinventory(GetSaved, player)
however,
require(player.PlayerGui.Modules.safeSystem):loadinventory(GetSaved, player)
works fine. All my other variables using the waitforchild method also broke. Is this a new Roblox update as yesterday it worked fine, or an error on my part?

It stopped working since the new Lua VM. What you said was a bug that has been repaired with the new Lua VM.

1 Like

By this do you mean that “(“WaitForChild”,“Blah”)” working was a bug or it not working is a bug?

It working was a bug, Engineers wasn’t wanting to add it, but a old bug added it.

1 Like

This was not a bug, but merely undocumented intended behavior for their previous implementation of __namecall which has changed on the new Luau vm. The correct solution would just be to use :WaitForChild() on the instance as it has been optimized due to the new Luau vm and the new implementation of __namecall.

3 Likes

No, the ability to call instances was an accident in the implementation of __namecall. It was never intentional, and even Roblox said to not rely on it because it wasn’t supported.