Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is the difference of module:newfunc() and module.newfunc()?

Asked by 4 years ago
Edited 4 years ago

Hey dev! I want know if is a difference if I make my script like

local module = {}

function module.newfunc() -- I use a simple dot (.)
       -- code
end

return module

And like

local module = {}

function module:newfunc() -- I use a double dots (:)
       -- code
end

return module

Sorry for my bad english isn't my original language. Im french!

0
the single dot is used for if it is in a brick already, and want it to find the part, or run the part. ex: game.workspace.part. the double dots is used for adding a new function to the script. ex: Parent:FindFirstChild("Humanoid") TheEmeraIdDev 22 — 4y

Answer this question