Stevenn Posted June 30, 2012 Share Posted June 30, 2012 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
50p Posted June 30, 2012 Share Posted June 30, 2012 This exports functions from this resource, so other resources can use them with callfunction: 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
Stevenn Posted June 30, 2012 Author Share Posted June 30, 2012 This exports functions from this resource, so other resources can use them with callfunction: 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
Castillo Posted June 30, 2012 Share Posted June 30, 2012 You can't use a client side exported function in a server side script. Link to comment
Stevenn Posted June 30, 2012 Author Share Posted June 30, 2012 You can't use a client side exported function in a server side script. I know, it is a client script Link to comment
Castillo Posted June 30, 2012 Share Posted June 30, 2012 I don't understand what is your problem. Link to comment
Stevenn Posted June 30, 2012 Author Share Posted June 30, 2012 nevermind i got it to work Link to comment
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