Karuzo Posted April 26, 2014 Share Posted April 26, 2014 Hey Guys, I wanted to create a small object-builder, but i just dunno why i can't see the created object. It outputs "object" but i don't see one. Hope you can help me. local opened function open() opened = not opened if opened == true then addEventHandler("onClientRender", root, GetCursor) showCursor(true) else showCursor(false) removeEventHandler("onClientRender", root, GetCursor) end end bindKey("m","down",open) local worldx,worldy,worldz function GetCursor() if isCursorShowing() then posx, posy, worldx, worldy, worldz = getCursorPosition() local obj = createObject(17950,worldx, worldy, worldz+5) if obj then outputChatBox("object") end end end Link to comment
tosfera Posted April 26, 2014 Share Posted April 26, 2014 Hey Guys,I wanted to create a small object-builder, but i just dunno why i can't see the created object. It outputs "object" but i don't see one. Hope you can help me. local opened function open() opened = not opened if opened == true then addEventHandler("onClientRender", root, GetCursor) showCursor(true) else showCursor(false) removeEventHandler("onClientRender", root, GetCursor) end end bindKey("m","down",open) local worldx,worldy,worldz function GetCursor() if isCursorShowing() then posx, posy, worldx, worldy, worldz = getCursorPosition() local obj = createObject(17950,worldx, worldy, worldz+5) if obj then outputChatBox("object") end end end I tried your code, rewrote your code, tried it again and I found out that the 3th, 4th and 5th coordinates are totally ignoring the floor. If you output the actual numbers it will give you a position that's quite far away. not only the height, but also the X and Y are wrong. Link to comment
Karuzo Posted April 26, 2014 Author Share Posted April 26, 2014 huh, that's weird. Is there anything to do against that? Link to comment
tosfera Posted April 26, 2014 Share Posted April 26, 2014 Well, you can try to use the processLineOfSight and see if that does hit the ground. Else I'm not sure. What about the editor? It's using the drag method too, I guess that is using the processLineOfSight. 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