Drakath Posted October 27, 2015 Share Posted October 27, 2015 Is there a way to check if the element was created by a specific resource? Link to comment
Addlibs Posted October 27, 2015 Share Posted October 27, 2015 getElementParent --as long as you don't change it manually beforehand, it should be linked to the Dynamic map, which's parent is the resource it originates from, i.e.: local obj = createObject(1337, 0, 0, 0) local map = getElementParent(obj) --usually the ID of this element is the name of the map XML file, or 'dynamic' as in, created by script, not map file local resourceElement = getElementParent(map) --nota bene: Resource element is not the same as Resource userdata local resourceName = getElementID(resourceElement) --works the same as getResourceName(resourceUserdata) but right now we only have the resourceElement, not the resourceUserdata local resourceUserdata = getResourceFromName(resourceName) Then you can check if the resource matches your criteria, i.e. if the name of it is equal to something, or if it's userdata is equal to, lets say, thisResource Link to comment
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