bv_hl
(cosinewaves)
December 28, 2023, 8:54pm
#1
I’m quite new to the entire module script and OOP side of ROBLOX, however I’m quite confused on a few things regarding module scripts.
One of my questions is whats the difference between using “:” and “.” for functions? For example, if I had these two functions;
function myModule.FunctionName(args)
end
or using;
function myModule:FunctionName(args)
end
I’m quite confused on this and I’d really appreciate the help.
2 Likes
Tebbot_Dev
(Tebbot_Dev)
December 28, 2023, 9:02pm
#2
this is how I use . and :
The “.” functions are mainly used for returning a value.
And the “:” are mainly used for functions that dont return a value like methods
3 Likes
bv_hl
(cosinewaves)
December 28, 2023, 9:03pm
#3
Ah okay thanks, so if I were to use a function lets say to determine whether the player was in a group or not, and return true or false to the server script, would it then be best to use “.”?
3 Likes
Tebbot_Dev
(Tebbot_Dev)
December 28, 2023, 9:06pm
#4
Yea it would be the best case to use “.”
2 Likes
bv_hl
(cosinewaves)
December 28, 2023, 9:07pm
#5
Alright!
'preciate it
sdasdasdas
2 Likes
Orbular3
(Orbular3)
December 28, 2023, 9:29pm
#6
Marked solution doesn’t make much sense so here’s a full explanation:
1 Like
system
(system)
Closed
January 11, 2024, 9:29pm
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.