Quote:
Originally Posted by papajchris
Can strings like clientr. and client only be numbers? When I do scripts such as the following, they don't appear in attributes.
PHP Code:
function onPlayerTouchsme() {
client.high3=false;
}
|
client and
clientr variables can be anything but objects.
PHP Code:
player.clientr.foo = "bar"; // string
player.clientr.bar = 10 ^ 3; // number
player.clientr.baz = {"one", "two"}; // array
player.clientr.baa = true; // boolean
Unlike languages like Java, Graal is a dynamically-typed language, which means you don't have to tell Graal what type of variable you want something to be. In Java, you would have to do
PHP Code:
String foo = "bar";
int bar = 10 ^ 3;
String[] baz = {"one", "two"};
boolean baa = true;
Since you don't have to do that in Graal, the engine internally converts certain values to others. This doesn't affect behavior in this case.
Setting a value to true will show it equal to
1. Setting it to false will either show it equal to
0 or remove it from attributes altogether. Either works.
If a variable has never been set to false, it will by default be false.