FlorjanMTARP Posted August 18, 2014 Share Posted August 18, 2014 I was wondering for the past few days, how to make a GUI show up when you right click a ped? Are there any resources samples? Sincerely, Florjan. Link to comment
Saml1er Posted August 18, 2014 Share Posted August 18, 2014 local t_button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) guiSetVisible ( t_button, false ) --- No point for this function if this is set to true addEventHandler ( "onClientClick", getRootElement(), function ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "up" and clickedElement then if getElementType( clickedElement ) ~= "ped" then return end guiSetVisible ( t_button, true ) end end ) Link to comment
FlorjanMTARP Posted August 18, 2014 Author Share Posted August 18, 2014 Saml1er thank you but do I have to create the ped firstly? Link to comment
Castillo Posted August 18, 2014 Share Posted August 18, 2014 Well, if you want it to work when you click a ped, you obviously need to create one. That script will also show the GUI when you click ANY ped. Link to comment
FlorjanMTARP Posted August 18, 2014 Author Share Posted August 18, 2014 Thank you Solidsnake, I appreciate yourhelp. AND ALSO Thanks Saml1er. EDIT) It does nothing ingame when I use LMB or RMB on another player. I've set it clientsided. Link to comment
Castillo Posted August 18, 2014 Share Posted August 18, 2014 This only works with peds, not players. Link to comment
tosfera Posted August 18, 2014 Share Posted August 18, 2014 Thank you Solidsnake, I appreciate yourhelp. AND ALSO Thanks Saml1er.EDIT) It does nothing ingame when I use LMB or RMB on another player. I've set it clientsided. You're trying to create a Roleplay script without knowing basic things like this ...? Maybe it's a good thing to get to know the basics before you take a big step and move to a RP script. Link to comment
FlorjanMTARP Posted August 18, 2014 Author Share Posted August 18, 2014 I know tosfera and thanks Solidsnake. Tosfera I made some cool scripts already and I want to work better from now. Thanks giuseppe. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now