Why is this checkpoint script not working?

Colons pass the table you called the method on as the first parameter:

function Object:Method(arg1, arg2)
-- Parameter line up: (Object, arg1, arg2)
-- Even though `self` isn't defined in the parameters, it's passed to the function's scope automatically (implicitly defined)

function Object.Method(arg1, arg2)
-- Parameter line up: (arg1, arg2)
-- The object wasn't passed nor is `self` accessible here

function Object.Method(self, arg1, arg2)
-- Parameter line up: (Object, arg1, arg)
-- This is the same as the first example except it uses a dot and explicitly declares `self`

For more: What is self and how can I use it? - #2 by WallsAreForClimbing

Edit: Misunderstood the question, but I’ll leave this up!

1 Like