Blockland Forums > Help
How do i display variables in a GUI?
PurpleMetro:
Easy. Displaying variables in VCE is not really like displaying variables in code.
--- Code: ---%a = 4;
commandToServer('messageSent',"The variable I said was "@%a@"");
--- End code ---
would make your player say "The variable I said was 4". So just basically to seperate strings from a variable in code, use "@ and @". Like parenthesies. This can be done in any message-viewing code such as
bottomPrint();
Announce();
centerPrintAll();
.etc
tony-0222:
So... say i added @%a@ in a textbox in the GUI. Would that makes the number for "a" show up there ingame?
Like ingame i use vce to set variable "a" to 4 (on client)
then set it to 7 (on player this time)
Would it show the variable from client or player?
Ok, maybe i didn't explain things good enough. Here what i need.
I click a brick and it gives me 10 wood. I do CTRL+Q and my GUI opens up. The number of wood i just got is displayed on the side in the GUI. That's my problem. How would i get the amount of wood i have displayed in the GUI like that?
Destiny/z0w0 did this in the DRPG i believe
tony-0222:
--- Quote from: tony-0222 on October 07, 2012, 09:53:24 PM --- The number of wood have is displayed on the side in the GUI.
--- End quote ---
Sorry for double post, no edit button.
PurpleMetro:
o dear, um i'm not entirely sure on how to retrieve variables from VCE, so in the meantime you should just make a brick with a code in it that says
--- Code: ---$a = 4;
--- End code ---
then in your GUI, in the textbox that shows the variable, put in $a