Sign in to follow this  
Drakath

OOP - Access data

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.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.