Jump to content

export a function?


Stevenn

Recommended Posts

Hello, I have this script:

Client:

function randomTest(text) 
    guiSetText (myLabel, text) 
end 
addEvent("randomTest", true) 
addEventHandler("randomTest", root, randomTest) 

Client:

triggerClientEvent(source,"randomTest", root, "the text") 

But how can I make it a exported function? So I could use something like:

exports["setText"] : randomTest ( "my text??" ) 
-- server 
exports["setText"] : randomTest ( source, "my text??" ) 

Link to comment
This exports functions from this resource, so other resources can use them with call

function: The function name

type Whether function is exported server-side or client-side (valid values are: "server" and "client")

http: Can the function be called via HTTP (true/false)

Link to comment
This exports functions from this resource, so other resources can use them with call

function: The function name

type Whether function is exported server-side or client-side (valid values are: "server" and "client")

http: Can the function be called via HTTP (true/false)

Ok, so I added

to the meta and then

exports ["testResource"] : randomTest("test") 

but no result :(

Link to comment

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