Question About Voicechat

Voicechatservice only exists on the client (localscripts)

Not sure if you’d know, but how can I make it run a remote event if they don’t have voice chat? Can’t seem to figure it out!

Let’s say you have a remote in ReplicatedStorage called VC:

Localscript:

local success, enabled = pcall(function() return game:GetService("VoiceChatService"):IsVoiceEnabledForUserIdAsync(game.Players.LocalPlayer.UserId) end)
if success then
game:GetService('ReplicatedStorage'):WaitForChild('VC'):FireServer(enabled)
end

Then on the server:

game.Players.PlayerAdded:Connect(function(p)
p:SetAttribute("VC", false)
end)
game:GetService('ReplicatedStorage').VC.OnServerEvent:Connect(function(Player, Enabled)
Player:SetAttribute('VC', Enabled)
end)

And then to check if a player has vc enabled, just call:

Player:GetAttribute('VC')