How to make invisible message?
3 replies



30.11.21 07:34:00 pm
I gonna make something like this:
If PlayerA say "!kill", playerB dont see this message
But i dont know how to do this, can you help me with it?
If PlayerA say "!kill", playerB dont see this message
But i dont know how to do this, can you help me with it?
Use the
say hook.

Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("say","saystuff")
function saystuff(p,txt)
if (txt=="!kill") then
parse("killplayer " .. p)
return 1
end
end
function saystuff(p,txt)
if (txt=="!kill") then
parse("killplayer " .. p)
return 1
end
end
return 1
is the important part. It prevents that the chat message is displayed/sent to other players.parse("killplayer " .. p)
is just what I assumed you want to do. You can replace that part with whatever you want. Many admin/chat scripts uses that mechanic to highlight VIP-messages:
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("say","saystuff")
function saystuff(id,txt)
if (player(id,"usgn") == 51028) then
msg("Bowlinghead [SuperCool]: "..txt);
return 1;
end
end
function saystuff(id,txt)
if (player(id,"usgn") == 51028) then
msg("Bowlinghead [SuperCool]: "..txt);
return 1;
end
end
Share time limited free games here

Maybe you can use "msg2" for clientsided message.
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("say","sayFunc")
function sayFunc(id, txt)
if (txt == "!kill") then
msg2(id, "Kill "..player(id, "name"))
parse("killplayer "..id)
end
end
function sayFunc(id, txt)
if (txt == "!kill") then
msg2(id, "Kill "..player(id, "name"))
parse("killplayer "..id)
end
end
[ String+ ] make string library more extended and advanced! | Kooshie is the best youkai




