xeon17 Posted November 3, 2014 Share Posted November 3, 2014 Why this doesen't work? local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" } addEventHandler( "onClientResourceStart", resourceRoot, function() if(not getElementData(localPlayer,"draw.hud")) then for _, component in ipairs( components ) do component:setHudComponentVisible(false) end end end) Debugscript: attempt to call method 'setHudComponentVisible' (a nil value) Link to comment
Anubhav Posted November 3, 2014 Share Posted November 3, 2014 There is no OOP for client-side! Link to comment
xeon17 Posted November 3, 2014 Author Share Posted November 3, 2014 There is no OOP for client-side! no? https://wiki.multitheftauto.com/wiki/OOP_client Link to comment
Anubhav Posted November 3, 2014 Share Posted November 3, 2014 (facepalm). There is Client OOP but not for this function. Use this local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted" } addEventHandler( "onClientResourceStart", resourceRoot, function() if(not getElementData(localPlayer,"draw.hud")) then for _, component in ipairs( components ) do component:showHudComponent(false) end end end) Link to comment
xeon17 Posted November 3, 2014 Author Share Posted November 3, 2014 I still got the same error 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