EXAMPLE :
player 1 typing !sayto 2 Hi !!
player 2 get messages Hi !!
without others can see that message
how to make it? teach me pls
function string.split(str,pat) 	local t={} 	for word in string.gmatch(str,pat) do 		if word~="" then 			table.insert(t,word) 		end 	end 	return t end addhook("say","pmessaging",118) function pmessaging(id,txt) 	local t=string.split(txt,"(%w+)") 	if (t[1]=="!sayto") then 		local ply=tonumber(t[2]) 		local words=txt:sub(t[1]:len()+1+t[2]:len()) 		msg2(ply,player(id,"name")..": "..words) 		return 1 	end end
function string.split(str,pat) 	local t={} 	for word in string.gmatch(str,pat) do 		if word~="" then 			table.insert(t,word) 		end 	end 	return t end addhook("say","pmessaging",118) function pmessaging(id,txt) 	local t=string.split(txt,"(%w+)") 	if (t[1]=="!sayto") then 		local ply=tonumber(t[2]) 		local words=txt:sub(t[1]:len()+1+t[2]:len()) 		msg2(ply,player(id,"name")..": "..words) 		return 1 	end end
function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end addhook("say","pmsg") function pmsg(id,txt) local p = totable(txt) local cmd = (p[1]) 	if cmd == "!sayto" then 		local pl = tonumber(p[2]) 		if player(pl,"exists") then 				local msg= string.sub(txt, 10, #txt) 				msg2(pl,"©235143041"..player(id,"name").." (PRIVATE): "..msg) 				msg2(id,"©235143041Private message to "..player(pl,"name")..": "..msg.." was sent!") 				return 1 		else 				msg2(id,"©255000000This player doesn't exists!") 				return 1 		end 	return 1 	end end
function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end addhook("say","pmsg") function pmsg(id,txt) local p = totable(txt) local cmd = (p[1]) 	if cmd == "!sayto" then 		local pl = tonumber(p[2]) 		if player(pl,"exists") then 				local msg= string.sub(txt, 10, #txt) 				msg2(pl,"©235143041"..player(id,"name").." (PRIVATE): "..msg) 				msg2(id,"©235143041Private message to "..player(pl,"name")..": "..msg.." was sent!") 				return 1 		else 				msg2(id,"©255000000This player doesn't exists!") 				return 1 		end 	return 1 	end end
addhook("say","action43") function action43(id,txt) if string.sub(txt,0,3) == "@pm" then local pl = string.sub(txt,5,6) if player(pl,"exists") then local msg = string.sub(txt,7,99) msg2(pl,"©235143041"..player(id,"name").." (PRIVATE): "..msg) msg2(id,"©000255000Your message has been succesful sent!") return 1 end end end
addhook("say"privatemsg") function privatemsg(id,txt) 	if txt:sub(1,6)=="!sayto" then 		pl = 0 		msg = "" 		if txt:sub(9,9)~=" " then 			pl = tonumber(txt:sub(8,9)) 			msg = txt:sub(11) 		else 			pl = tonumber(txt:sub(8,8)) 			msg = txt:sub(10) 		end 		if player(pl,"exists") then 			msg2(id,string.char(169).."255255255Private message "..player(pl,"name")..": "..msg) 			msg2(pl,string.char(169).."255255255"..player(id,"name").."(Private): "..msg) 		end 		return 1 	end end