Jump to content

/freq script

Recommended Posts

Hello people, I need a /freq script how it works 1. the person puts /freq (Number) in the t that the person chooses 2. a message of these appears the freq (selected number) 3. that when they touch Ctrl + z You can speak via voice chat on the chosen frequency 4. People who speak on the frequency below the right appear. I need this script for a server under development

Link to comment
  • 3 weeks later...

You can use setElementData
For Example:

function changeFreq (freq)
if getElementData(source, "freq") == freq then return outputChatBox("You're already on "..freq.." frequency !", source, 255, 0, 0) end
  setElementData(source, "freq", freq)
outputChatBox("You are now on "..freq.." frequency.", source, 0, 255, 0)
addCommandHandler("freq", changeFreq)


function freqChat(plr, command, ...)
  if getElementData(plr, "freq") == false then return outputChatBox("Get a frequency first by using /freq <freqNumber>, For example /freq 3", plr, 255, 0, 0) end
local freq = "( "..getElementData(plr, "freq").." )"
local message = table.concat({...}, " ")
	local fullMessage = freq.." "..getPlayerName(plr)..": "..message:gsub("#%x%x%x%x%x%x", "")

	for i, v in ipairs(getElementsByType("player")) do
		if (getElementData(v, "freq") == getElementData(plr, "freq")) then
			outputChatBox(fullMessage, v, 255, 255, 255, true)
addCommandHandler("fc", freqChat)


Note: I didn't test the code

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...