Sign in to follow this  
Vazern

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

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.

Share this post


Link to post
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)

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.