How to make voice chat only server?

Hello! I wondering how to make a voice chat only server, for example, the mimic that has to type /vc to teleport to the vc server.

5 Likes

it can be exploited but the only way.

if game:GetService("VoiceChatService"):IsVoiceChatEnabled(game.Players.LocalPlayer.UserId) then else game.Players.LocalPlayer:Kick("no vc") end

Localscript Inside startergui, put it in the vc only game

4 Likes

Yeah, exactly. So, what you could do is that in a place you could kick out the players if they don’t have voice chat (Example script by @geometricalC2123.)

1 Like

Thanks for this method!

2 Likes

If you don’t mind, could you please mark my post as solution?

Edit : thanks

1 Like

That’s the wrong instance method. It should also be wrapped inside a call to the pcall() global as it’s an API request and is thus prone to errors (if the request times out/connection drops etc.).

local voiceChat = game:GetService("VoiceChatService")
local players = game:GetService("Players")
local player = players.LocalPlayer

local success, result = pcall(function()
	return voiceChat:IsVoiceEnabledForUserIdAsync(player.UserId)
end)

if success then
	if not result then
		player:Kick("Voice chat disabled.")
	end
else
	warn(result)
	player:Kick("API request failed.")
end
6 Likes

forgot to wrap inn pcalls, lol

2 Likes

hello developers,

i want to know how to make a button / hit part for teleport only voice chat servers. if someone could help me, it would be great!

thanks developers,

2 Likes
script.Parent.Touched:Connect(function(hit)
	local placeid = 0 -- the id for your vc only server
	local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
	if player then
		game:GetService("TeleportService"):Teleport(placeid) 
	end
end)

Like this?

3 Likes

i mean for voice chat servers only / proximity and Gui Click.

(voice chat servers = players with voice chat)

1 Like

So teleport the player only if they have voice chat?

1 Like

robloxapp-20220321-1945175.wmv (442.8 KB)

Like that but with Gui Click and Proximity Prompt.

1 Like

yes. like that. that is what i’m trying to find.

1 Like

I don’t think you can access voice chat on the server, here is something that might work.
(NOTE: PUT A REMOTEVENT IN REPLICATEDSTORAGE NAMED “VoiceChat”)

Server script inside your part:

local ProximityPrompt = script.Parent:WaitForChild("ProximityPrompt")
local RS = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local event = RS:WaitForChild("VoiceChat")

ProximityPrompt.Triggered:Connect(function(plr)
event.OnServerEvent:Connect(function()
    local placeid = 0 -- your place id
    TeleportService:Teleport(placeid)
		
	end)
end)

Client script:

local voiceChat = game:GetService("VoiceChatService")
local RS = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local player = players.LocalPlayer
local event = RS:WaitForChild("VoiceChat")

if voiceChat:IsVoiceEnabledForUserIdAsync(player.UserId) then
event:FireServer()
else
	print("No VC!")
end

Roblox Studio place:
proximityprompt.rbxl

Enjoy :slight_smile:
Reply if you have any problems.

5 Likes

Thanks, i’m Testing this Out! :smiley:

1 Like

Wait, I found an easier way to do this just on the client, it includes the gui text as well.

Local script into StarterGUI or StarterPlayerScripts:

local voiceChat = game:GetService("VoiceChatService")
local TeleportService = game:GetService("TeleportService")
local Workspace = game:GetService("Workspace")
local part = Workspace:WaitForChild("Part") -- edit to name of your part
local proxp = part.ProximityPrompt
local players = game:GetService("Players")
local player = players.LocalPlayer
local plrgui = player.PlayerGui
local gui = plrgui:WaitForChild("Denied")





proxp.Triggered:Connect(function()
	if voiceChat:IsVoiceEnabledForUserIdAsync(player.UserId) == false then
	local text = gui.TextLabel
	text:TweenPosition(UDim2.new(0.297, 0,0.886, 0) , "InOut", "Quad", .2)
	task.wait(.8)
	text:TweenPosition(UDim2.new(0.297, 0,1, 0) , "InOut", "Quad", .2)
	
	elseif voiceChat:IsVoiceEnabledForUserIdAsync(player.UserId) then
		local placeid = 0 -- edit to your place id
		TeleportService:Teleport(placeid)
	end
end)

Roblox place:
proximitypromptgui.rbxl

Enjoy :smile:

3 Likes

thanks!

I’ve been inactive, so sorry, for not responsing. anyways, thank you so much! i tested it out, thanks!

1 Like

no problem, have a nice day dude

2 Likes