WelCome Posted September 29, 2018 Posted September 29, 2018 Hello, I have a problem, when I move the cursor, the object becomes invisible gate = Object(1337,712.61853, 659.00409, 9.94867) addEventHandler('onClientRender',root,function() if not isCursorShowing() then return end local _,_,wx,wy,wz = getCursorPosition() gate:setPosition(wx,wy,wz) end)
JeViCo Posted September 29, 2018 Posted September 29, 2018 (edited) function attached to onClientRender event won't work if you used return at least once gate = Object(1337,712.61853, 659.00409, 9.94867) addEventHandler('onClientRender',root,function() if isCursorShowing() then local _,_,wx,wy,wz = getCursorPosition() gate:setPosition(wx,wy,wz) end end) @WelCome Edited September 29, 2018 by JeViCo
WelCome Posted September 30, 2018 Author Posted September 30, 2018 @JeViCo What?? Wiki: Quote This event is triggered every time GTA renders a new frame. It is required for the DirectX drawing functions, and also useful for other clientside operations that have to be applied repeatedly with very short time differences between them. No errors
Dimos7 Posted October 7, 2018 Posted October 7, 2018 gate = Object(1337,712.61853, 659.00409, 9.94867) addEventHandler('onClientClick',root,function() if isCursorShowing() then local _,_,wx,wy,wz = getCursorPosition() gate:setPosition(wx,wy,wz) end end) Try this
Moderators Patrick Posted October 7, 2018 Moderators Posted October 7, 2018 Do without OOP. gate = createObject(1337, 712.61853, 659.00409, 9.94867) addEventHandler('onClientClick', root, function(_,_,_,_,wx,wy,wz) setElementPosition(gate, wx,wy,wz) end)
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