Import variable from lua file

Hello,
i try import variable from lua file. For exhample (in resources server scripts):
“a.lua”

value = "Hello World"

“b.lua”

require "a.lua"
print(value)

and error:

Error loading script a.lua in resource test: @test/a.lua:1: attempt to call a nil value (global 'require')
stack traceback:
        @test/a.lua:1: in main chunk
Failed to load script a.lua.

Thanks for any help

Lua runs in a sandbox mode, so require won’t work. If you’re sharing a variable between different files within a resource you can do this as long as they’re both on the server/client.

Yes both of files are in server side.

Then you don’t need to do anything, just simply call the variable as long as it is not localised.

Can you please show me an example?