Is there any way to build your own editor tip? When you use a Roblox’s built-in functions, there is a little editor tip or code tip to guide you on how to use it. “E.g, This function uses two parameters”.
I have built my own functions within a modulescript. Although it is self-explanatory because of the name but I would like to see the editor tip or code tip when I type it out again within the script.
The editor tip and examples are copied directly off of Roblox’s Documentation Website, so it’s pretty much impossible to create a code tip for your function.
However, you can use Type Checking, in which the editor tip window will display what the parameter’s value should be.
local module = {}
function module.Foo(a: number, b: number): number
return a + b
end
return module
So, when getting the declaration for the function Foo, this appears:
This shows that a and b must be a number, and that the function returns a number as well.
Note that no syntax errors show whenever you use this feature.
Thank you kexy123. I will look into using that. When I see other people’s code, when they use this, I always wonder why they use this method and it confuses me. Your explanation helps me to understand why they choose to use this.