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.
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
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 @regexman.)
If you don’t mind, could you please mark my post as solution?
Edit : thanks
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
forgot to wrap inn pcalls, lol
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,
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?
i mean for voice chat servers only / proximity and Gui Click.
(voice chat servers = players with voice chat)
So teleport the player only if they have voice chat?
yes. like that. that is what i’m trying to find.
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
Reply if you have any problems.
Thanks, i’m Testing this Out!
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
thanks!
I’ve been inactive, so sorry, for not responsing. anyways, thank you so much! i tested it out, thanks!
no problem, have a nice day dude