WelCome Posted September 29, 2018 Share 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) Link to comment
NeXuS™ Posted September 29, 2018 Share Posted September 29, 2018 Any error in the debugscript? Link to comment
JeViCo Posted September 29, 2018 Share 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 Link to comment
WelCome Posted September 30, 2018 Author Share 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 Link to comment
WelCome Posted October 6, 2018 Author Share Posted October 6, 2018 someone can help me ? Link to comment
Moderators Patrick Posted October 6, 2018 Moderators Share Posted October 6, 2018 Is OOP enabled? Link to comment
WelCome Posted October 6, 2018 Author Share Posted October 6, 2018 Yes <oop>true</oop> Link to comment
Dimos7 Posted October 7, 2018 Share 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 Link to comment
Moderators Patrick Posted October 7, 2018 Moderators Share 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) 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