What is the difference or why do we put . before some functions and : before other functions?
I recently gave an answer to a very similar question.
If you're indeed referring to the dot and comma syntax when calling the default Roblox API functions, the behaviour is still the exact same. The API and its documentation uses the dot syntax for class constructors (such as CFrame.new
) and colon syntax for other member functions. This doesn't mean that either cannot be called with the other syntax (although none of the constructors accept a blank class as an argument, so the comma syntax can't really be used with constructors).
For example, game.FindFirstChild(workspace, "Baseplate")
is totally valid syntax. It calls the Instance.FindFirstChild
function with the Workspace
service as the first argument and a string Baseplate
as the second argument. The function call is attempting to find a child named Baseplate
from the Workspace
service.