Is there a difference between this 2 functions?

Hello! Simple question, is there a difference between the “.” and the “:” functions?

local list = {}
list.example = function() end;
function list:example() end;

This should help:
https://www.lua.org/pil/16.html

The main difference is that with the colon you can use the self parameter in Object Oriented Programming.

1 Like

Here’s a simple example:

local repStorage = game:GetService('ReplicatedStorage')

is the same as

local repStorage = game.GetService(game, 'ReplicatedStorage')
1 Like