Jump to content

[HELP] OOP


xeon17

Recommended Posts

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

(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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...