greenops011 Posted June 1, 2022 Posted June 1, 2022 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?
FernandoMTA Posted June 1, 2022 Posted June 1, 2022 (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 June 1, 2022 by FernandoMTA 1 Nando's Resources https://forum.multitheftauto.com/topic/139644-rel-nandos-resources/
Moderators IIYAMA Posted June 1, 2022 Moderators Posted June 1, 2022 @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. 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
greenops011 Posted June 2, 2022 Author Posted June 2, 2022 awesome, thanks guys. that was really helpful 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now