Repository navigation
Replies: 2 comments
|
Additionally, |
0 replies
|
I’m currently also missing a way to send a message directly to a player or to all players. Using import { Instance } from "cs_script/point_script";
Instance.OnPlayerChat((event) => {
let response = "[Response] " + event.text;
Instance.ServerCommand("say " + response);
});I was able to work around this issue in the following way: import { Instance } from "cs_script/point_script";
let response = "";
let ignore_message = "";
let message_time = 0;
Instance.OnPlayerChat((event) => {
if ( event.text === ignore_message ) return;
response = "[Response] " + event.text;
message_time = Instance.GetGameTime();
});
Instance.SetThink(() => {
if ( response !== "" && Instance.GetGameTime() > message_time + 0.5 ) {
Instance.ServerCommand("say " + response);
ignore_message = response;
response = "";
}
Instance.SetNextThink(Instance.GetGameTime());
});
Instance.SetNextThink(Instance.GetGameTime());However, this solution is not ideal either. What I’d really like is a way to send a message directly to the chat or HUD without it being attributed to any specific player. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Similar to
ClientPrintfrom TF2 vscript: It would print a message to a specified player, or null to broadcast to everyone. Currently the only alternative is doingInstance.ServerCommand("say message")All reactions