• Any way to call an entity's methods like you would call an object's in java?
    5 replies, posted
Is there any way to call a method within an entity like you would call an object's method in Java? I have an entity in the world that, for an example, has a function called "postMemes()" in it that when called prints "Memes!" to console. Is there a way to do something like "ourentity.postMemes()"?
I might be wrong, but you could try with: function ENT:PostMemes() print("Memes!"); end And then you simply somehow get the entity and call their method: -- entity being the reference to that entity entity:PostMemes();
Tried that. Oddly enough it didn't want to let me do it. Might have misspelled it?
How do we know when you share no code whatsoever? What @DyaMetR described should work fine.
What do you mean that it didn't want to let you do it. Is it an error? Maybe you're trying to call a clientside method from the server or viceversa. Could you post the error? And if you could, sharing your attempts would be fine aswell.
Forgot to add ENT: to the beginning of the function.
Sorry, you need to Log In to post a reply to this thread.