I got a bit curious, and wondered if there was a keyword by the name of execute
, to my surprise, it is a keyword, but when I use the code print(type(execute))
or print(execute
), the Output says nil
, also, the ROBLOX Wiki does not have any information on this keyword other than How to Execute a code
, you can also change it as an identifier, here's an explanation of what I mean;
local execute = print --The keyword 'execute' is now an identifier for 'print' local print = "Hello World!" --'print' is now an identifier for the string 'Hello World!' execute(print) --Output: Hello World!
I am curious on what this type of keyword is used for, or, what it was used for, also, I am not too if the keyword execute
has anything to do with String Manipulation
.
The ROBLOX IDE doesn't highlight keywords in the smartest way.
Consider
print(random)
It will highlight random
. This is because math.random
is a built in function.
There is no significance to the name random
on its own (or even much significance to the name math.random
since math
is just a table and "random"
a key in it).
execute
is similar. It comes from os.execute
, which runs shell commands, e.g.,
os.execute("gcc source.c -o program.exe")
You can't use os.execute
in ROBLOX, so it's sort of silly to bold execute
anyway.
From Lua Users Wiki
os.execute([command])
Execute an operating system shell command. This is like the C system() function. The system dependent status code is returned.
With no argument, this command returns a non-zero value if an OS shell is presents or a zero value if one is not present.