The script works except for line 5 (print("Voice Chat Is Disabled For “…player.Name”)
How do I fix this?
Script:
local VCS = game:GetService("VoiceChatService")
local player = game.Players.LocalPlayer
if VCS:IsVoiceEnabledForUserIdAsync(player.UserId) == true then print("Voice Chat Is Enabled For "..player.Name)
else
print("Voice Chat Is Disabled For "..player.Name)
player:kick("To play this game you must have voice chat enabled!")
end
I’m not sure what that is. I don’t know how to script other then going on the roblox dev site and getting the script and fixing it to how I want it to work.
I removed the kick line to test and see if it prints on the alt. It does print in console on the alts side but when I go to my main account side I cannot see it
I think IsVoiceEnabledForUserIdAsync is down for some reason?
Oh yea and this should kick the player if they join.
local Players = game:GetService("Players")
local VoiceChatService = game:GetService("VoiceChatService")
local function PlayerAdded(Player)
local success, enabled = pcall(function()
return VoiceChatService:IsVoiceEnabledForUserIdAsync(Player.UserId)
end)
if success and (not enabled) then
Player:Kick("Voice chat is not enabled")
else
print("Api down?")
end
end
Players.PlayerAdded:Connect(PlayerAdded)
for _, Player: Player in pairs(Players:GetPlayers()) do
task.spawn(PlayerAdded, Player)
end
thats because its a LocalScript, they only function on your side. your main account has Voicechat enabled so it doesn’t prints the thing you wanted but on the alt account it has Voicechat disabled so it runs the print function for the alt account.
if you liked the solution make sure to mark it as a solution.