zixxonx Posted December 28, 2014 Posted December 28, 2014 toilet1 = createElement("toilet", "toilet1") toilet1:setData("times_used", 0) Hello! I'm pretty new to OOP in LUA and i have a problem. It's my code. But when i run the script it's giving me this error: attempt to index global 'toilet1' (a userdata value) I really dont know why. Could someone help me? OOP is enabled in mtaserver.cnf
TAPL Posted December 28, 2014 Posted December 28, 2014 (edited) https://wiki.multitheftauto.com/wiki/OOP#Turning_it_on By default, OOP is disabled (however, vectors and matrices are always available) - this is mainly because the vast majority of servers will prefer to stick to what they know - procedural programming. In fact, functions are still available even when OOP is enabled. Enabling OOP is as simple as adding the following line to the resource meta file: true mtaserver.conf have nothing to do with oop. Edited December 28, 2014 by Guest
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now