Whats happening when you use strings to fill arguments in functions?
Asked by
5 years ago Edited 5 years ago
I noticed something kinda weird about print()
in roblox, or really just something that isnt very intuitive to me.
In lua, stuff like math
or string
are tables that contain functions related to them.
If you do something like print(type(print)
you get a function. Furthermore, how come I can do stuff like this?
Even though I'm not calling the print function like this, print()
; how does the script know the difference between calling the function with ()
and me just writing the name of the function?
Ive also noticed you can only do it with strings (afaik) so you can only do things like this:
1 | local function epicPrintWrapper(String) |