- Documentation
- Client events
- onClientPlayerVoiceStart
Event
onClientPlayerVoiceStart
A player started talking through voice chat (for the local player: their microphone started transmitting). You can block another player's utterance: then this player does not hear it until they stop talking.
Handler
addEventHandler("onClientPlayerVoiceStart", root, function() ... end)Source
source is the talking player.
cancelEvent() mutes this utterance for this player only.
Example
local blocked = {}
addCommandHandler("ignoruj", function(_, nick)
local p = nick and getPlayerFromName(nick)
if p then blocked[p] = true end
end)
addEventHandler("onClientPlayerVoiceStart", root, function()
if blocked[source] then cancelEvent() end
end)
See also
onClientPlayerVoiceStopA player stopped talking through voice chat.isPlayerTalkingChecks whether a player is talking through voice chat right now. On the client, for the local player it means their microphone is transmitting.getPlayerVoiceLevelReturns how loud a player is talking right now:-1when silent, and while talking a level from0(quiet) to3(loud). Useful for your own talk indicators.