Is there a way to define functions to say what they do?

You know how when you’re typing in an Roblox implemented method like :Destroy() it gives a bunch of context as to what it does? Is that possible to do with module methods in Roblox Studio?

Here’s what I’m talking about regarding the context given by Roblox implemented methods (I’m talking about the bottom part where it says “Connects the given …”:

I’ve seen this done in modules like TopbarPlus but how it’s done is a mystery to me.

1 Like
function YourFunction():"Your Description Here"
	
end

I know if this is not exactly what you want but it’s still close

-- function description here
local function YourFunnyHahaFunction()

end
3 Likes

I tried this for module functions before but it didn’t work, also this isn’t a module function.

that’s interesting. worked for me on a normal server script function. i’ll dig into this.

This reply works for me. Both for scripts and functions required from module scripts. It also works without the space in front of the comment(so you can do --comment directly instead of -- comment). The only “restriction” that seems to be in place is that the comment must be exactly above the defined function(without new lines in between).

Nevermind, I was just putting a gap between the comment and the function, turns out you mustn’t put a gap there. My bad.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.