manve1 Posted July 30, 2013 Posted July 30, 2013 I looked over search for how to use "onClientClick" for when client clicks on an object that was created and i couldn't find it. So my question is; Could anyone give me an example of how to make it?
xXMADEXx Posted July 30, 2013 Posted July 30, 2013 So a script that returns an object when the client clicks?
manve1 Posted July 30, 2013 Author Posted July 30, 2013 When he clicks on an object that was created client sided
Vector Posted July 30, 2013 Posted July 30, 2013 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);
manve1 Posted July 30, 2013 Author Posted July 30, 2013 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
manve1 Posted July 31, 2013 Author Posted July 31, 2013 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);
manve1 Posted July 31, 2013 Author Posted July 31, 2013 possible to make a collision that would work when clicked on M4?
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