Unable to use the IsVoiceEnabledForUserIdAsync() function

I’m currently trying to make a spatial voice only game on Roblox; a game where only players with spatial voice enabled can join. Currently, when trying to use VoiceChatService, coupled with the IsVoiceEnabledForUserIdAsync(), I get an error.


“VoiceChatService:IsVoiceEnabledForUserIdAsync() is not yet implemented on the server”
I tried looking for the documentation for VoiceChatService on developer.roblox.com but couldn’t find the page for it, I also haven’t found anyone else with this issue.

Here’s my code:

local VoiceChatService = game:GetService("VoiceChatService")
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local UserId = player.UserId
	local voice_enabled = VoiceChatService:IsVoiceEnabledForUserIdAsync(UserId)
	if not voice_enabled then
		player:Kick("You need to have voice enabled to play this game.")
	end
end)
2 Likes

Since this feature is in Beta, it could probably mean that only CoreScripts can access it at the moment, meaning you will need to wait for the full release.

Or, it could be that you haven’t enabled it yet, make sure it’s enabled!
You can go here to see how to do this.

1 Like

Must be a CoreScript only thing then, I already made sure the voice chat feature was enabled.

2 Likes

Lol I’m actually looking for the same thing, I’ve contacted another developer whos successfully done it.
When a user joins this with spatial they will be redirected to another world/server full of users with spatial voice enabled, Ill let you know if I figure anything out :stuck_out_tongue:
If you wish to see for yourself heres the link :slight_smile:
https://www.roblox.com/games/6985028626/Roblox-Community-Space

1 Like

There’s probably some features that are accessible to only certain games, VoiceChatService in Community Space for example, since it was the first game with Spatial Voice. I think eventually we’ll have access to the feature, it’s just a matter of time.

1 Like

Yeah, I talked to the ROBLOX admin in Community Space Alligator said the feature is there, but is not yet available for normal players.
Note I found this too

(I also talked to another Administrator and he says Spatial Hangout has the feature enabled because the group is owned by a ROBLOX Administrator)

1 Like

Looks like they added the API reference for it

1 Like

Just to answer your question, Looking at your output I can see that you were trying to use the method on the server which is not supported yet. You’re able to use VoiceChatService:IsVoiceEnabledForUserIdAsync(UserId) on the client not the server.

Also note that the request may fail so it’s best if you wrap it in a pcall function.

PS: Use the method on a localscript in the client.