What does the colon mean in functions?

I’m a bit new to sciripting, so apologies in advance, but what does the colon mean in this?

local Init = function(Button:TextButton)

When you call a method, use the colon notation (:) instead of dot notation (.) to pass self as the first argument automatically . All objects in Roblox descend from Instance and have commonly used methods including Instance:Destroy(), Instance:Clone(), and Instance:FindFirstChild().

– Copied from the roblox documentation

More info here: Functions | Roblox Creator Documentation

3 Likes

I don’t think you even read anything but the post title. I was asking for the arguments part, not the creating part. But thanks though

For anyone wondering the answer, it’s just a placeholder so that the recommendations show up for like .Size or .Position

3 Likes

It’s called type notations.

2 Likes

It’s basically saying hey, this variable is of this type. So a type checking sort of thing (not fully but eh)

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