Jump to content

Metatable events?


Goodguy

Recommended Posts

I've looked at http://lua-users.org/wiki/MetatableEvents and some other tutorial websites but can't seem to understand it. Currently I'm getting an issue that pops up as "Object table 0x1060508076 did not have __call metatable set" and cannot seem to find a solution to my issue. I know the __call event allows for the table to be used as a function but can't seem to quite understand it. If anyone has a way to explain it a bit more in-depth that would be greatly appreciated! Thank you.

Edited by Goodguy
Link to comment
Share on other sites

The error is trying to tell you that somewhere in your code you try to call a table as a function. 

 

So you probably have something like

local foo = {};
foo();

in your code.  The stack trace should tell you in which file and in which line the error occured.

Link to comment
Share on other sites

1 hour ago, RoboMat said:

The error is trying to tell you that somewhere in your code you try to call a table as a function. 

 

So you probably have something like


local foo = {};
foo();

in your code.  The stack trace should tell you in which file and in which line the error occured.

So say I have something like this:

Players = {};

function Players.IsSplitscreen(_player)
	~Code Here
end

Events.OnCreateIsoPlayer.Add(Players.IsSplitscreen);

It gives me an error at the Events.OnCreateIsoPlayer.Add(Players.IsSplitscreen); part. And also thanks for your help!

Link to comment
Share on other sites

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
×
×
  • Create New...