I am trying to create a way so that players are able to use / commands without typing them into the chat.
When they type out the command they want to use (ex: "Self Delete") into a gui, and that is saved as a global variable: $globalvariable
in order for this to accomplish anything, I need to send the command to the server
commandtoserver($globalvariable);
as soon as that line is hit, the game crashes with no error code.
I have tried to do things like:
eval("commandtoserver($globalvariable);");
but it still crashes.
Is there a way around this? How does blockland convert the string you enter into the chat into a variable so it can be sent as a command to the server?
I played around with this for a bit and I did the following:
==>commandtoserver('Self Delete');
==>commandtoserver($variable = 'Self Delete');
==>echo($variable);
62
==>commandtoserver(62);
Remote Command Error - command must be a tag.
==>commandtoserver($variable);
none of these caused me to crash, but then I tried this:
commandtoserver("Self Delete");
and the game crashed
So now my question is, how can I convert a variable from a "" string to a '' string? How can I get it so that this:
$globalvariable = randomgui_textentry.getvalue();
saves $globalvariable as a '' type string instead of a "" one?
Is the trick using a different kind of gui text box?