Sending data between 2 functions?

Hey, I need to know how I would send data between 2 lua functions!

One is my dermapanel(car_panel.lua) script and one is my npc script(car_customizer.lua).

I only need to send one single variable between the scripts, how do I do this?

Just make the variable global

[editline]18th January 2016 at 05:09PM[/editline]

Assuming this is clinet to client or server to server. It would help if you where more specific as to what you want transferred.

You could use the netlibrary for this: https://wiki.garrysmod.com/page/Net_Library_Usage

Depending if you want to send data from client to server or server to client you either use net.SendToServer() or net.Send(). All the other information you need is in that link.

You shouldn’t think of it as sending data between one function and the other, think whether you need to send data from client to client, client to server or server to client.

Hi, I am Andres Kramack from http://www.cathybarryadultstore.com/.

It’s a ‘pleasure’ serving the public if you know what I mean and this message is

Here at Cathy Barry Adult Store, we offer a wide variety of dildos that come in all sizes from goblin-sized dicks to black-man draconic dicks. I know at Facepunch everyone loves good old dicks which is why I personally offer anyone with an association with Facepunch Forums a 50% discount code “DIL4FACEPUNCH”. Don’t forget, this offer lasts until the next Garry’s Mod update which we so much love.

Here are pictures of our products just for you!

Sponsored Images:

http://static.fjcdn.com/pictures/Gym+leaders+hate+him_ab471d_5017861.jpg

https://static.fjcdn.com/comments/That+one+with+the+lamp+got+me+_e68beb19422eea14289caa5f4d6dffb7.jpg

Got any questions? Visit my Steam Profile!