API Reference & Tips
API - Reminders, Helpful tips, and things you should know before starting.
Press F5 to reload and replay scripts while Stream Avatars is connected!
To view the console log, focus Stream Avatars, and press Alt+C, then type: Lua After hitting enter, a console logger will come up showing you the logs. Once it is open, you can close the command input by pressing Alt+C again.
You can close the console log by repeating this process.
Do's and Don'ts
function anotherFunction()
--see how this function is above the return function()?
--the double dash is how we make line comments in lua scripting
--[[
this is how we make block comments in lua scripting.
multiple lines. woooo
]]
log('hello world');
end
return function()
anotherFunction();
--this should be the last function of your script!
end --Don't put anything below the last endreturn function()
local test = 'hi';
local test2 = false;
if test2 == false and test == 'hi' then
log('&& operators is just and');
else if test2 == true or test == 'bye' then
log('|| operators is just or');
end
if test2 == false then
log('simple if');
end
if test2 == false then
log('simple if else');
else
log('blah');
end
endcoroutines are unique in SA Lua. They allow for scripts to wait for something to finish before continuing. Do not cross global variables between coroutines! This can be tricky to use but is very powerful for scripting sequences of events.
Pre-existing Functions and Data
With LUA scripting in stream avatars, there are some addons your your script behind the scenes that you should know about!
Only exists when the custom command is set to Run As: On Command Call
commandUser is the user that issued the command causing this script to run.
commandMessage is the message that was sent to issue the command.

Last updated