News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Lua load files  (Read 714 times)

0 Members and 1 Guest are viewing this topic.

Offline RBS ID

  • Jr. Member
  • **
  • Posts: 67
  • Gender: Male
  • I don't know.
    • View Profile
    • This is website title.
Lua load files
« on: February 01, 2022, 05:00:32 AM »
How to load a file that has some user's configuration of the mod, and then use the data(variables, tables) in the mod's script. Anyone know?

And 1 again, is it possible to load a user's configuration setting file that isn't a compiled file, like  .txt, or .ini?

Sorry for bad English.

Offline Razc01na

  • Lord Slayer
  • Full Member
  • ***
  • Posts: 156
  • Gender: Male
  • Doom is life
    • View Profile
Re: Lua load files
« Reply #1 on: February 01, 2022, 06:43:41 AM »
You can't load data from .txt nor .ini...

You can, however, create an other .lua with that data and compile. Then use the ImportScript function to import as a library.
Exemple if your library file is libra.lur, put this on your main script:

Code: [Select]
ImportScript(libra.lua)(scripts in bully are always ended in .lua)