LabiVila Posted December 13, 2014 Share Posted December 13, 2014 local x,y = guiGetScreenSize () function looting () for k,v in pairs (getElementsByType ("object")) do if getElementModel (v) == 2991 then local px, py, pz = getElementPosition (localPlayer) local ox, oy, oz = getElementPosition (v) dis = getDistanceBetweenPoints3D (px, py, pz, ox, oy, oz) if dis < 3 then dxDrawText ("You can loot the item, hold R.", x/3, y/3, x, y, tocolor (255, 255, 255, 255)) addEventHandler ("onClientKey", root, function (button, release) if button == "R" and release then outputChatBox ("R has been typed, ...") end end ) end end end end addEventHandler ("onClientRender", root, looting) The message "R has been typed, ..." isn't working, I'd appreciate some help. Link to comment
Bonsai Posted December 13, 2014 Share Posted December 13, 2014 Why inside of the render function? Even inside of a loop. /debugscript should throw a lot of warnings/errors. Link to comment
LabiVila Posted December 13, 2014 Author Share Posted December 13, 2014 Why inside of the render function? Even inside of a loop. /debugscript should throw a lot of warnings/errors. It actually doesn't. However, fixed, thanks anyway 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