SWEP showing derma form?

Hi, I am building a SWEP that shows a derma form that supposed to be launched on the SWEP:SecondaryAttack() function but I can work out how to make it happen.
What I know is that the SWEP:SecondaryAttack() has to be on the server side and the derma stuff has to be on the client side but I don’t know how to call a function on the client side from the server side.

Also, I have two tables and two numerical variables that I need to somehow get from the server side to the client side so they can be used on the derma form.

All I’m asking is if anyone knows how to to call functions across the client - server interfaces and also update variables

I have worked out how to call functions on the client side from the server side and I can also send the numerical variables to the client using usermessages, but I still cant send tables. I figure that I could get around sending the tables if i can just send a message back to the server. So does anyone know how to send a message back to the server side script?

Generally if you want to send large amounts of data, it’s good to use **[Datastream.StreamToClients

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Datastream.StreamToClients)**. You can send whatever variables you want.

And to send a “message” back to the server, you can just use concommands. You can give arguments to concommands.

Note: if you can solve your problem using concommands and not datastream, then do it that way. Datastream is notorious for being inefficient and/or ineffective.

Thankyou for your help :slight_smile: I was able to solve my problem with concommands

I’d use usermessages if I were you but if you already solved the problem then so be it.

Well I did for the server to client part but I couldn’t use that method for sending data back to the server.

Well yeah for C => S use concommands, but nvm since you already know that