!mute
!unmute
help me D=
Scripts
Mute Lua
Mute Lua
1

addhook("say","_say")
addhook("sayteam","_sayteam")
addhook("join","_join")
admins={89367}
muted={}
function is_admin(usgn)
	for _,id in pairs(admins) do
		if usgn==id then
			return true
		end
	end
	return false
end
function _say(id,message)
	if is_admin(player(id,"usgn")) then
		if string.sub(message,1,6)=="!mute " then
			local id2=tonumber(string.sub(message,7))
			if id2 and player(id2,"exists") then
				muted[id2]=true
				msg(string.char(169).."255000000"..player(id2,"name").." has been muted.")
				return 1
			end
		elseif string.sub(message,1,8)=="!unmute " then
			local id2=tonumber(string.sub(message,9))
			if id2 and player(id2,"exists") then
				muted[id2]=false
				msg(string.char(169).."255000000"..player(id2,"name").." has been unmuted.")
				return 1
			end
		end
	elseif muted[id]==true then
		return 1
	end
end
function _join(id)
	muted[id]=nil
end
function _sayteam(id)
	if muted[id]==true then
		return 1
	end
end
Apache uwu has writtenaddhook("say","_say")
addhook("sayteam","_sayteam")
addhook("join","_join")
admins={89367}
muted={}
function is_admin(usgn)
	for _,id in pairs(admins) do
		if usgn==id then
			return true
		end
	end
	return false
end
function _say(id,message)
	if is_admin(player(id,"usgn")) then
		if string.sub(message,1,6)=="!mute " then
			local id2=tonumber(string.sub(message,7))
			if id2 and player(id2,"exists") then
				muted[id2]=true
				msg(string.char(169).."255000000"..player(id2,"name").." has been muted.")
				return 1
			end
		elseif string.sub(message,1,8)=="!unmute " then
			local id2=tonumber(string.sub(message,9))
			if id2 and player(id2,"exists") then
				muted[id2]=false
				msg(string.char(169).."255000000"..player(id2,"name").." has been unmuted.")
				return 1
			end
		end
	elseif muted[id]==true then
		return 1
	end
end
function _join(id)
	muted[id]=nil
end
function _sayteam(id)
	if muted[id]==true then
		return 1
	end
end
Apache uwu has written
J4x has written
Jhony: Well, maybe you're using another script which contains a function with say. Try to use this by itself or just try to implement it into your scripts other function with the say hook.
krabob has written
Jhony: Well, maybe you're using another script which contains a function with say. Try to use this by itself or just try to implement it into your scripts other function with the say hook.
Apache uwu has written
Apache uwu: neverthelessismuted={}
for id=1,32 do
ismuted[id]=false
end
addhook("say","muteply")
function muteply(id,t)
if (t:sub(1,5)=="!mute") then
local mid=tonumber(t:sub(6))
ismuted[mid]=true
end
if (ismuted[id]) then
return 1
end
end
1
