Jump to content

Help with scripting !


Loschi

Recommended Posts

Hello, good evening.


Could someone help me, I am creating a script and I want to compile it, but I want to have a configurable file for people.
How do I create an edit.lua file? 


I would like this file to edit information that is in the compiled server.lua !

Thank you all !

Link to comment

edit.lua

-- Put configuration into _G the global variables so that they can be imported by compiled.lua
config1 = "test"
config2 = 42
...

compiled.lua

-- Import the configuration as local variables.
local config1 = config1
local config2 = config2
...

meta.xml

<meta>
  <script src="edit.lua" type="server" />
  <script src="compiled.lua" type="server" />
</meta>

This is the pattern that I recommend based on your description.

You chose an awkward topic title for such a specific problem.

Edited by The_GTA
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...