Blockland Forums > Modification Help
Button commands
Headcrab Zombie:
--- Quote from: Pah1023 on September 03, 2011, 04:16:13 PM ---Sorry for double posting but I found out that it uses an action map.
But now I need the variables and there two different commands.
Actionmap.bind()
and actionmap.bindcmd().
Wich do I use?
--- End quote ---
Wait, you said in the OP that you want to press a button on a GUI and have that do a command, now you're saying you want a keybind?
These are two completely different things, which do you want?
Pah1023:
--- Quote from: Headcrab Zombie on September 11, 2011, 07:14:34 PM ---Wait, you said in the OP that you want to press a button on a GUI and have that do a command, now you're saying you want a keybind?
These are two completely different things, which do you want?
--- End quote ---
Sorry if I didnt make complete sense, I meant for you can only press it if the gui is open, if its not, the keyboard button will do nothing.
Xalos:
--- Quote from: wizzlemanizzle on September 11, 2011, 06:30:26 PM ---sorry for bump, hope this helps though
In your case:
actionmap.bind(keyboard0, Z, , , function(););
however... I don't think it is possible to make it so that this ONLY works while a specific GUI is open....
--- End quote ---
new GuiBitmapCtrl(GuiZButton)
{
command = "blah_blah_blah();"; //this runs when you press the accelerator or click the image
accelerator = "Z";
//all the required variables, I don't know which ones are and which ones aren't
//pretty sure for a bitmap you need a profile and a filepath
};