Docs
  • 🍎Stream Avatars
    • Introduction
    • ⏩Quick Setup
    • 📸How to Overlay
      • OBS
      • Streamlabs Desktop
      • XSplit
      • Twitch Studio
      • Unlisted / Other
    • ⚛️Extension
    • ⏩Quick Guide
    • 📬Commands
      • ❗!commands
      • ↕️Selection Commands
        • !random
          • !mass random
          • !change {user} {command} random
        • !avatars
          • !avatar {avatar}
          • !change {user} !avatar {avatar}
          • !change {user} !avatar {avatar} {timer}
          • !mass avatar {avatar}
          • !mass avatar {avatar} {timer}
        • !color
        • !gear
        • !nametags
        • !actions
        • !show
      • ↕️Minigames and Fun Commands
        • !basketball
        • !battleroyale
        • !boss
        • !duel {user} {amount}
        • !slots {amount}
        • !bomb {user}
        • !sling {power} {angle}
        • !fart
        • !quote {#}
        • !roll {#d#}
        • !8ball {question}
        • !freeze {user} {seconds}
        • !pin {user} {x%} {y%} {seconds}
        • !attack {user}
        • !dance
        • !hug {user}
        • !throw
        • !explode {target}
        • !bet {amount} {calltype}
        • !scale {target} {size}
        • !spawn game
        • !screensaver {seconds}
        • ↕️!mass {command}
      • ↕️Shop Commands
        • !shop
        • !buy avatars
        • !buy colors
        • !buy gear
        • !buy nametags
        • !buy actions
      • ↕️Currency Commands
        • !currency
        • !currency add {user} {amount}
        • !currency remove {user} {amount}
        • !currency give {user} {amount}
      • ↕️Gifting Commands
        • !gift {user} lootbox {name}
        • !gift {user} avatar {avatar}
        • !gift {user} gear {gear_set} {gear_piece}
        • !gift {user} color {avatar} {color}
        • !gift {user} nametag {nametag}
        • !gift {user} all true
        • !currency add {user} {amount}
      • ↕️Remove Ownership Commands
        • !remove {user} avatar {avatar}
        • !remove {user} gear {gear_set} {gear_piece}
        • !remove {user} color {avatar} {color}
        • !remove {user} nametag {nametag}
        • !currency remove {user} {amount}
      • !extension
      • !hideavatar
      • !mass {command}
      • !change {user} {command}
      • !spawn {title}
      • !whitelist add {user}
      • !blacklist add {user}
      • !mod add {user}
      • !leaderboard
      • !leaderboard exclude {user}
      • !game exclude {user}
      • !sounds
      • !shoutout {user}
    • 📃Application Settings
      • General
      • Login Details
      • Minigames
      • Avatars And Gear
      • Sounds
      • Nametag Settings
      • Import & Export
      • Shop Editing
      • User Editing
      • ❗Unfinished Docs!
      • ❗Bot Commands
        • ❗Custom Commands
      • ❗Edit Lootboxes
      • ❗Backgrounds
      • ❗Bot Commands
    • 🎨Content Creating
      • Creating Avatars
      • Extension Sorting Order
      • Deleting Avatars, Palettes/Colors, and Gear
      • Creating Gear
      • Creating Colors
      • Creating Backgrounds
      • Creating Bosses
      • Creating Player Classes (boss)
      • Creating Nametags
      • Creating Lootboxes
      • Importing Scripts
      • Importing Private Content
      • Creating Custom Redemptions
      • Creating Extension Thumbnails
      • Creating Custom Language Localization
    • 💫Integrations
      • Stream Deck
    • ❓Support
      • New Platform Additions
      • Various Troubleshooting
      • Data Folder
      • Beta Branch
      • F.A.Q
      • Crash Log - Event Viewer
    • 🤝Stream Avatars Partner
  • ⚙️LUA Scripting API
    • Introduction
    • Quick Start
    • API Reference & Tips
      • 🌎Global Functions
        • log
        • wait
        • yield
        • yieldBreak
        • async functions
        • waitForAsync function
        • stopAsync function
        • get
        • set
        • applyImage
        • waitForAnimation
        • webrequest get/post
        • getUser
        • getUsers
        • getUserById
        • getCurrency
        • addCurrency
        • removeCurrency
        • adjustCurrency
        • getBackground
        • getScriptableBlocks
        • getAvatar
        • getAllAvatars
        • runCommand
        • writeChat
        • setProperty
        • getApp
        • save
        • load
        • addEvent
        • removeEvent
        • keepAlive
      • 🔫Events
        • BankController
        • ServiceController
        • Read Chat
        • Websockets
        • Scriptable Block Trigger
        • Platform Donation
        • App State Change
        • Custom Command
        • Basketball Outcome
        • BattleRoyale Outcome
        • Boss Battle Outcome
        • Boss Battle Player Joined
        • Duel Outcome
        • On JumpCatch Star
        • On Background Switch
        • On Avatar Change
        • On New Viewer
        • On InitializeNewViewer
        • On Follower
        • On Raid
        • On Subscriber
        • On Avatar Spawn
        • On Trigger Object
        • On Hotkey
        • On Purchase
      • 📦Classes
        • App
          • globalAvatarScale {get;set}
          • globalNametagScale {get;set}
          • globalChatBubbleScale {get;set}
          • globalNametagStack {get;set}
          • getResolution
          • platformServiceSettings
          • setResolution
          • setFullscreen
          • getStreamer
          • convertPositionToPercent
          • convertPercentToPosition
          • playSound
          • createBomb
          • pitchSound
          • stopSound
          • soundIsPlaying
          • createGameObject
          • getGameObject
          • createChatBubble
          • createWebsocket
          • removeWebsocket
          • sendWebsocketMessage
          • getAppState
          • sha256_base64
          • getUserFromData
          • getIdsFromData
          • deleteUser
          • exportAvatarImage
          • translateCommand
        • User
          • id {get}
          • isActive {get}
          • isFake {get}
          • lastActiveDate {get}
          • secondsSinceLastActive {get}
          • displayName {get}
          • channelName {get}
          • follower {get}
          • vip {get}
          • subscriber {get}
          • moderator {get}
          • platformModerator {get}
          • platform {get}
          • streamer {get}
          • avatar {get;set}
          • scale {get;set}
          • override_scale {get;set}
          • color {get;set}
          • nametag {get;set}
          • getState
          • getGear
          • setGear
          • setPosition
          • getPosition
          • getWearableAvatars
          • getWearableAvatarColors
          • getWearableGearSetPieces
          • getWearableNametags
          • setTemporaryAvatar
          • setTemporaryColor
          • setTemporaryNametag
          • setTemporaryGear
          • setTemporaryNone
          • clearAllTemporarySelections
          • chatBubble
          • runCommand
          • physics
          • saveUserData
          • loadUserData
        • Physics
          • grounded {get;set}
          • setVelocity
        • ObjectPhysics
          • hasTrigger {get}
          • hasRigidBody {get}
          • layer {get;set}
          • kinemetic {get;set}
          • setVelocity
          • addBoxCollider
          • addCircleCollider
          • addBoxTrigger
          • addCircleTrigger
        • Avatar
          • name {get}
          • getGear
          • getGearPieces
          • getColors
          • getActions
        • GameObject
          • image {get}
          • destroy
          • setAngle
          • setPosition
          • getPosition
          • adjustPosition
          • getScale
          • setScale
          • adjustScale
          • physics
        • Image
          • playAnimation
          • stopAnimation
          • flipX
          • flipY
          • sorting
          • anchor
        • ScriptableBlock
          • id {get}
          • position
      • 📤Helper Class
        • createCooldown
        • checkCooldown
        • setCooldown
        • cooldownTimeLeft
        • startsWith
        • replace
        • split
        • randomElement
        • hasValue
        • matchRegex
Powered by GitBook
On this page
  • Overview
  • Access API Externally
  • Start Scripting
  1. LUA Scripting API

Introduction

API -

PreviousStream Avatars PartnerNextQuick Start

Last updated 2 years ago

Overview

SA LUA scripting allows you to run commands through an internal API and make changes to SA while it's connected. The LUA scripting is run in a sandbox mode with restrictions on what can be done on your computer. This makes it safe to import other scripts because the only thing that can be impacted negatively is your Stream Avatars data and the application's performance.

If you are looking to quickly add community created scripts, visit the Importing Scripts page.

Access API Externally

If you are looking for an API that allows another application to interact with your SA, you will have to write your own communications.

Web-sockets and http-get/post are a good way to pass information back and forth between an external application and SA

Alternatively you can write commands into the streaming-platform's chat box and have SA run instructions based off read through a LUA script.

Start Scripting

Want to start making a script from scratch? Find more information and tricks with the link below.

⚙️
Importing Scripts
Websockets
webrequest get/post
chat messages
Quick Start