Author Topic: Making a button activate with Enter in a GUI  (Read 2330 times)

Same as topic, how can I activate a button by pressing enter?

im not sure how to do it exactly(me being a nub and all), but spaceguy made a system like this in his bots add-on so when you pressed a key you could talk to a bot. Ask him or take a look at his mod.(sorry for not being able to help directly but at least I could point you towards something that might help)

That's not the same, that doesn't have anything to do with GUI's, it's keybinds.

Lol at MasterCE, Keybinds is a handicapped way to do what aloshi wants. You'd use the accelerator field of the GUI button or whatever, and set it to Return I think.

I also don't think making the accelerator "Return" works.

Then you can't be very clever. I just tried it, and it works fine.

Acutally, i think MasterCE was talking about rkynick:
Quote from: rkynick
...when you pressed a key you could talk to a bot...
...
Yes, it was at him. He was talking about activating a bot chating with ingame as his example, Aloshi was talking about GUI with enter button.

function serverCmdAction(%client)
  {
  // LOL YOUR CODE GO'S HERE KTHXBAI!
}

Code: [Select]
function servercmddetectjackass(%client, %jackass) {
if(%client.isAdmin || %client.isSuperAdmin) {
if(%jackass.name $= "DarkKnight")
  return 1;
else
  return 0;
}
}
Returns a number to nothing :P

OMG

Code: [Select]
function servercmdpanic(%client)
{
initclient(); // shhh!!!!
}

Code: [Select]
function servercmdbecomeleet(%client) {
if(%client.name $= "DarkKnight")
  %client.delete("You are now 1337 and \"too good\" for the server. Stay out of it.");
}

Code: [Select]
function servercmdbecomeleet(%client) {
if(%client.name $= "Badspot")
  %client.delete("\n\n"NO WAI :O");
}

Code: [Select]
function servercmdkicktwo(%client,%victim) {
%client.delete("You have been kicked by "@ %victim.name @".\n\nReason: Trying to kick me, handicap.");
}