Jump to content

[HELP] Use "string.find" to start mods that have a given TAG.


Vazern

Recommended Posts

Good night, good morning, or good afternoon!
I am a beginner on the moon, I would like to know how to use string.find, or some other method, to start a mod that has a particular tag. In my case, I put the tag "[VZR]" in my mods.

Thank you.

Link to comment
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function()
	for _,v in ipairs(getResources())do
		local name = getResourceName(v)
		if string.find(name,"tag")then
			startResource(v)
		end
	end
end)

addEventHandler("onResourceStop",getResourceRootElement(getThisResource()),function()
	for _,v in ipairs(getResources())do
		local name = getResourceName(v)
		if string.find(name,"tag")then
			stopResource(v)
		end
	end
end)

 

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