Jump to content

Element check


Drakath

Recommended Posts

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

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