Jump to content

script dependancy check


Recommended Posts

Posted

Not sure if this is the correct place to ask this, but here we go.

 

I'm basically getting started on learning LUA scripting, and am trying to use an old roleplay gamemode to learn. one thing I am wondering is is there a way to find out if one particular lua script depends on another?

 

Basically if I were to take an lua script from one section of the game mode, modify it, and test it stand-alone, I don't want to break the script, so what I'd like to try to do is use notepad++ to search for a particular string (like if the lua file calls a second lua file). Does anyone know what the code I would need to look for is?

Posted (edited)

The 2 most common ways of interacting with other resource scripts is:

- calling exported functions like: exports.resourceName:functionName or exports["resourceName"]:functionName

- calling events, you should look for which were added in other resources: triggerEvent, triggerServerEvent, etc

Edited by FernandoMTA
  • Like 1
  • Moderators
Posted

@greenops011

If the developer sets another resource as a dependency, then the <include /> tag should ? have been used in the meta.xml.

https://wiki.multitheftauto.com/wiki/Meta.xml

If not, then indeed as Fernando explains, the functions you should look for.

  • Thanks 1

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...