Jump to content

Execute a command when clicking a button


..:D&G:..

Recommended Posts

Hello, its me (again :P ) I am starting to flood a bit with posts, sorry about that, but I started working on some scripts and I don't really know all the functions and events and how to write them (some).

So, I want to know how to trigger a command ''/jump for example'' when clicking a button from a gui.

Shall I use this:

function  jumpbabyjump() 
    triggerServerEvent("jump",getLocalPlayer(),getLocalPlayer()) 
end 
addEventHandler ( "onClientGUIClick",bJump,jumpbabyjump, false ) 

or:

executeCommandHandler( "jump",  jumpbabyjump) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...