Is there anyway to make a variable for find first child instead of just typing the whole this every time?
for example
local FFC = FindFirstChild
workspace:FFC(“Part”)
Is there anyway to make a variable for find first child instead of just typing the whole this every time?
for example
local FFC = FindFirstChild
workspace:FFC(“Part”)
Yes, however it’s gonna be ugly as you have to pass workspace to the function because of syntactic sugar.
local ffc = 'FindFirstChild'
workspace[ffc](workspace, 'Part')
You could also probably make your own function but it’s really going to be messy so I recommend just using instance:FindFirstChild
local function findFirstChild(instance, ...)
return instance:FindFirstChild(...)
end
findFirstChild(workspace, 'Part')