Skip to content

Instantly share code, notes, and snippets.

@IosysPio
Created June 6, 2019 17:22
Show Gist options
  • Save IosysPio/d25bae781dd55908328e256f9b4d6b29 to your computer and use it in GitHub Desktop.
Save IosysPio/d25bae781dd55908328e256f9b4d6b29 to your computer and use it in GitHub Desktop.
VCIで複数の音声の中から1つをランダムに再生する例
_VA = vci.assets
sCount = 3 --- 音声ファイルの個数
---
function onUse(self)
--- グリップしたときに実行される
local num = math.random(sCount) --- 最大値がsCountの乱数発生
_VA._ALL_PlayAudioFromIndex(num) --- num番目の音声を再生
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment