Jump to content

OOP Functions


3B00DG4MER

Recommended Posts

Posted

Hi guys,

I tried to Export an OOP function like that:

function dxEditBox:create() 
  
end 

<export function="dxEditBox:create" type="client" /> 

i Called it like that :

exports.RESOURCENAME:dxEditBox:create() 

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted
    local menu = exports[ "SAFMenu" ].Menu_create( localPlayer, bot:getData("name"),155,0, 0 ) 
    loadstring(exports[ "SAFMenu" ].Menu_open( localPlayer,absoluteX, absoluteY ))(menu) 

failed to call 'SAFMenu:Menu_open' [string "?"]

Bad Argument 1 [Expected String got Boolean]

attempt to call a boolean

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted
  
Menu = {} 
Menu.__index = Menu 
Menu.instances = {} 
Menu_open = Menu.open 
function Menu:open(x, y) 
... 
     return self 
end 
  

        <export function="Menu_open" type="client" /> 

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted
local menu = exports[ "SAFMenu" ].Menu_create( localPlayer, bot:getData("name"),155,0, 0 ) 

As far as I know, exports is a table, but exports["SAFMenu"] is more like a class... I think you were meant to put a semi-colon ( : ) instead of the period ( . ) between exports["SAFMenu"] and Menu_create

Previously known as MrTasty.

Posted (edited)
Menus = {} 
Menus.main = exports[ "SAFMenu" ]:Menu_create("Test",155,0, 0 ) 

That Line Works

That one is killing ME !

exports[ "SAFMenu" ]:Menu_open(Menus.main,absoluteX, absoluteY ) 

Failed to call:"SAFMenu:Menu_open" [string: ?]

Edited by Guest

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

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