Jump to content

triggerServer/ClientEvent return


Seif

Recommended Posts

I was trying to recreate GUI functions server side and that requires triggerClientEvent. However I noticed it doesn't return the function value, rather true/false. I had to go through multiple steps to use guiGetScreenSize server-side and I'd hate to do the same with every gui function(over 100). What I had to do was use a global variable server-side to store the width and height. I reset them when the client joined, then after a second I called a client side function that gets the screen size and then it calls a server side function to store the values in those global variables.

Any tips? I want to use GUI server-side because client-side functions are downloaded.

Link to comment

there is no other way to do it. you trigger the client, run a clientside function then trigger the server with the result

my advice would be dont bother. nothing of any consequence should ever go into the clientside files anyway, gui designs are dime a dozen and i dont think them being stolen is justification for this much work. if you are really worried you could try compiling or obfuscating your scripts, it wont stop anyone determined enough but most people will leave it alone

you could also try something like this which would essentially send your whole clientside script as a string through an event then load it on the other side, so it exists only in memory. its not a particularly elegant solution but for smaller scripts its probably ok

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