Jump to content

Export classes?


Recommended Posts

Posted

Hi. Let me give you an example:

local Car = {}

function Car:new(model, color1, color2, plate, ...)
  --create a vehicle
  --return the created vehicle
end

If i want to reach this class from an other script, how can i export the class, and not the functions?

Posted

Exports currently do not support this. Workarounds include exporting a function which returns a string of lua code which you can loadstring() to have the class defined within the current resource.

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