Is there a way to get a variable from a server script from sss using console to print the variable value?
If its possible, can you teach me how?
Thanks.
The only way to access a script’s text is through their Source property, only accessible by plugins and the command bar. I tested and DevConsole doesn’t have access to this property. Unless your “variable” is a ValueType instance, you can’t do what you want.
Basically this will boil down to why you need this. By default, no there isn’t a way to do so. But if you need it in studio there are lots of debugging stuff for this type of thing. If you need it live in a game though, it is possible, but you will need to do a lot more set up such as saving every variable inside a table so you can call it by name in game.
You can either make a new instance for your variable, like StringValue/NumberValue etc (Value property). Or go to properties and add a new attribute to the script and use GetAttribute or SetAttribute. You will have to consistently set the values though.
No other way to really do it securely.