FiguraSVC
This is an unofficial addon for the Figura mod that enables Figura Lua scripts to detect and interact with Simple Voice Chat functionality.
Documentation
Complete documentation and usage examples are available in the project repository. A wiki page with detailed instructions will be created in the near future.
Example Script
-- Talking animation
local microphoneOffTime = 0
local isMicrophoneOn = false
function pings.talking(state)
-- (safe on servers) (visible to all players)
animations.model.talk:setPlaying(state)
end
function events.tick()
local previousMicState = isMicrophoneOn
microphoneOffTime = microphoneOffTime + 1
isMicrophoneOn = microphoneOffTime <= 2 -- has svc.microphone been called in the past 2 ticks?
if previousMicState ~= isMicrophoneOn then
pings.talking(isMicrophoneOn)
end
end
if client:isModLoaded("figurasvc") and host:isHost() then
function events.HOST_MICROPHONE(pcm)
microphoneOffTime = 0
end
end