what is , and . in roblox
In Roblox Lua, . and : are not the same: . is used to access a function
or value on a table, while : is used to call a method and automatically
passes the table as self.
What . means
object.functionNamemeans βget this function or value from the object.β- Example:
module.DottedFunction()calls the function directly without automatically passing the object.
What : means
object:functionName()is shorthand forobject.functionName(object).- Example:
module:ColonFunction()passesmodulein as the first argument, which is why itβs common for class-like or OOP-style code.
Simple example
Part.Toucheduses.because you are accessing the event.event:Connect(function() ... end)uses:becauseConnectis a method that expects the event object asself.
One-line rule
Use . to access , use : to call methods that should receive the
table automatically.
Quick note
If you meant , and . in Roblox chat or typing, tell me the exact context,
because in scripting the important symbol difference is usually . vs : or
.. for joining text.