Overkillz Posted October 24, 2019 Posted October 24, 2019 Well, Im going to be clear. Why is this not working ? --##Resource A exports["resource_Name"].testExportF("Hello") --##Resource B function testExportF(message) outputChatBox(testStringA) end --RESULT: bad argument @ 'outputChatBox' [Expected string ar argument 1, got nil] And why is this working with a 2nd argument --##Resource A exports["resource_Name"].testExportF("Hello", "hello2") --##Resource B function testExportF(message) outputChatBox(testStringA) end --RESULT: hello2 Exported function is clientside as u can see and resource name doesn't containt illegal characters Regards.
Overkillz Posted October 24, 2019 Author Posted October 24, 2019 @Felix5k Yes, as you can see im getting the drop message but with the 2nd way.
Discord Moderators Zango Posted October 24, 2019 Discord Moderators Posted October 24, 2019 It's because you're missing the colon exports["resource_Name"]:testExportF("Hello") Basically when you do table:method(arg), Lua passes along "table" as the first parameter, so it's effectively doing table.method(table, arg) If you just do exports.resource.function then it's expecting that first parameter. Even though you can do exports.resource_Name.testExportF(nil, "hello") 1
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