Jump to content

OOP - Access data


Drakath

Recommended Posts

Is there a way to access the data of another class?

Thing = inherit( Singleton ) 
  
function Thing:constructor( ) 
    self.myTable = {} 
end 
     
addEvent("someEvent", true) 
function myFunc(something) 
    triggerClientEvent(client, "haha", root, --How do I access myTable[something] ? 
    ) 
end 
addEventHandler("someEvent", root, myFunc) 

I know I could do Thing:MyFunc() and then access self.myTable but my question is whether there is an alternative way for this.

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...