This might sound ridiculous but how do i add one to a variable with a keybind.
look at my code
myScript.attributes.add("coinAmount", {type:"entity"});
//this code is in the update function
var x = 0
if(this.app.mouse.wasPressed(pc.MOUSEBUTTON_LEFT)){
x + 1;
}
this.coinAmount.element.text = x;
It shows 0 on the text but when i press my mouse button it does not increase
and the code that isn’t the attribute is in the update function
btw, what variable do you guys use except x
- x
- y
- n
0 voters