Skip to content

execute()

TheCrazyInsanity edited this page Nov 30, 2022 · 2 revisions

Pretty neat function, assuming you dont want to just join the game, this is a very important function.

Needs to be called BEFORE the client script is executed, this really shouldn't be a standalone function because of this but it is oh well.
Ok now the arguments
execute(pathtofile,'"scriplet1","scriplet2"') pathtofile: The path to the file to be executed, not much more to be said.
Scriplets: If you know what you are doing, you may notice something very off about the second argument, these are scriplets. This argument is a comma separated string of values appended to the top of the script being executed, for example if the file contained
print(scripletarg1)
print(scripletarg2)
and the execute function was
execute(./thisfile.lua, '"first","last'')
the output would be
first
last
Point to note is scriplets are actually put in backwards into the script, for instance in the above example scripletarg2="last" would be above scripletarg1
Also DO NOT put spaces before or after separating commas it will break it probably, its a beta okay?
Another point to note that might not be easy to see is scriplets is one argument, encase it entirely in ` or ' not " though

The nodeblox wiki, if this wiki doesnt help solve your problem dm me on discord TheCrazyInsanity#4828

Clone this wiki locally