Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
On pressing any button, the first thing that function does is call clearButtons() on the object, then do all the work (maybe with a delay from a startLuaCoroutine() or Wait.time()), then when it's finished I call showButtons() again.
You could dynamically build your buttons table to exclude a certain number e.g. when pressing button 1, the table will be built with all buttons but the button at index 1 in your button table, and then after the delay, clear the buttons and show them all.
EDIT:
nvm I'll use your method
https://api.tabletopsimulator.com/object/#call
Buttons are always made at the first "free" index, with no return value coming from createButton makes it tricky to store which button is kept at which index. I find it easier to just clear the buttons and remake them, excluding the one i wish to omit.
You can pull a table of the buttons on an object using getButtons()
https://api.tabletopsimulator.com/object/#getbuttons
If you're ever unsure of what data you're dealing with, use log(knight.getButtons()) in your code, then in the log part of your chat window (looks like a ~ symbol) it'll show you the structure of the data to help you work with it. This would show you that getButtons() returns an array with numerical indexes. You can't access numerical indexes with the . syntax, only putting the number in [] will work. (this is because named variables cannot begin with a number in Lua)