SORK>Soxxml Posted February 6, 2019 Posted February 6, 2019 (edited) hello community, i was want to make dxdrawtext shown when player use armour and it will hidden after 5 sec here is the function i made but it have error any help please? sorry for bad english Spoiler addEvent("startArmour", true) addEventHandler("startArmour", getRootElement(), function () addEventHandler("onClientRender", root, function() dxDrawText("equipting armour", 342, 259, 907, 322, tocolor(28, 135, 226, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) end ) thanks for reading Edited February 6, 2019 by SORK>Soxxml
Moderators IIYAMA Posted February 6, 2019 Moderators Posted February 6, 2019 (edited) addEvent("startArmour", true) addEventHandler("startArmour", getRootElement(), function () addEventHandler("onClientRender", root, renderArmour) end) function renderArmour () dxDrawText("equipting armour", 342, 259, 907, 322, tocolor(28, 135, 226, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false) end You need two separated functions for that. See also this source-code/tutorial if you want to pass arguments: Edited February 6, 2019 by IIYAMA 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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