Help with arguments

I want to make my own function options

I do not know how to do this:
image
But on my own module function

None

I want to make the function have their own so called “Visible Arguments” but I do not know how. My module only has a ... parameter but I want it to show the other ones without it showing ...

function module:WaitForChildWhichIsA(...)
	
	local args = {...}
	
	if typeof(args[1]) ~= "Instance" or typeof(args[2]) ~= "string" then warn("Attempt to index 'args' with an invalid value") return nil else end
	
	local Parent = args[1]
	local Object = args[2]
	
	for _, v in pairs(Parent:GetDescendants()) do
		
		repeat wait(0.1) until v
		
		if v:IsA(Object) then
			print(v.Name)
			return Parent
		end
	end
end

I need to use this so people can see how to use it.

I don’t really understand for some reason, can you explain more clearly?

Also can’t you just use 2 arguments for your function?

Yes so you know how normal local functions if they have parameters then it shows the parameter icon thing when you try calling the function I want to make my own custom ones on my module functions without the … or adding anymore parameters

For e.g.
image

I am not sure I fully understand what you’re trying to say, but from what I understand from your post, I believe you’re trying to make your own implementation of Instance:FindFirstChildWhichIsA(classname). Forgive me if I am wrong!

but here’s how I would go about it:

function module:WaitForChildWhichIsA(parent, className)
    if not (typeof(parent)=="Instance" and typeof(className)=="string") then
   	warn("Wrong arguments provided")
	return
    end

    while true do
   	local obj=parent:FindFirstChildWhichIsA(className);
    	if(obj) then return obj end;
    	parent.DescendantAdded:Wait();
    end
end

I am just wondering if I can make my own visible parameters like this.
image

those parameters are visible because of the roblox code editor, they have no effect on code! and Yes, I do believe once you set up a module and require it, the roblox code editor sometimes displays the functions and all of its parameters for you from a different script

But look it doesnt for me ever:
image
And I need the param as … for less code lol

I am sorry I know this isnt topic but what is this error?
image

The roblox code editor is a bit unpredictable; It sometimes displays, and sometimes it doesn’t. So my advice to you would be to write good code with predictable arguments so that you don’t need to rely on the code editor

and

The error says that FindFirstDescendant is not enabled; meaning that either roblox has not released the function to everyone, or they disabled it, or its only accessible to core scripts, or you have to enable it someway in roblox studio.

2 Likes

So I cannot do it? :frowning: :frowning:

it seems so. There’s no sort of mechanics to control what the code editor does.

1 Like