Jump to content

Simple question


manve1

Recommended Posts

  
addEventHandler ("onClientClick", getRootElement (), 
      function (button,state,absoulteX,absoluteY,worldX,worldY,worldZ,elementClicked) 
              if not elementClicked then return end;  -- if set to false, there is no element clicled. 
              -- elementClicked is the element clicked by the client.  
              -- do whatever... 
      end); 
  

Link to comment

changed your script just a bit and as this event is new to me i would like help on fixing it.

addEventHandler ("onClientClick", getRootElement( ), 
      function (button,state,absoulteX,absoluteY,worldX,worldY,worldZ,elementClicked) 
              if elementClicked == M4 then outputChatBox("Works") return end;  
              outputChatBox("Fails.") 
      end); 

Just so you know, it does contain an object "M4" that was created

Link to comment
local M4 = createObject(356, 1934.90002, -2356.69995, 12.8, 90, 0, 0) 
createBlipAttachedTo( M4, 0, 1, 0, 255, 0 ) 
  
addEventHandler ("onClientClick", getRootElement( ), 
      function (button,state,absoulteX,absoluteY,worldX,worldY,worldZ,elementClicked) 
              if elementClicked == M4 then outputChatBox("Works") return end;  
              outputChatBox("Fails.") 
      end); 

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...