Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: VScript Function SendToConsole() does not exist in Client Side scripts #1803

Open
Pacca64 opened this issue Jan 11, 2025 · 0 comments
Open
Labels
Type: Bug Something isn't working

Comments

@Pacca64
Copy link

Pacca64 commented Jan 11, 2025

Describe the bug

Pretty self explanatory, attempting to use SendToConsole(string) via script_client or script_execute_client gives the following error:
[vscript] AN ERROR HAS OCCURED [the index 'SendToConsole' does not exist] [vscript] CALLSTACK [vscript] *FUNCTION [main()] unnamed line [1] [vscript] LOCALS [vscript] [this] TABLE

The expected behavior would be to run the command on only the client executing the script, but it fails instead. This makes it difficult to make client side utility functions that change convars or client side configurations (like keybinds) dynamically.

While it can be worked around by running on the server, that will affect all connected players, or require further workarounds like spawning entities and abusing I/O, which could potentially disrupt map logic by mistake. It also prevents access to client side StorageScopes from the Storage api, meaning saved configuration data would be tied to the server for all players, instead of being stored locally on the client.

Issue Map

This can be tested on any map with console commands.

To Reproduce

  1. load any map to enable VScript
  2. run this command:
    script_client SendToConsole("say hello world!")
  3. read the output.

Operating System

No response

@Pacca64 Pacca64 added the Type: Bug Something isn't working label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant