This works for me:
Two things to note:
1) it only takes "direct" parents of the node, its not upwards recursive, so doesnt take parents of the node's parents into account
2) CheckTrustedNodes (or equivalent security) will need to be correctly set
You can run the script directly on an object using "Execute server script" to check whats going on.
I suggest adding this into the foreach loop to make debug easier:
Code Select
parents = GetObjectParents($object);
foreach(p : parents)
{
if (p->type == 5 && p->name == "Something") return true;
}
return false;Two things to note:
1) it only takes "direct" parents of the node, its not upwards recursive, so doesnt take parents of the node's parents into account
2) CheckTrustedNodes (or equivalent security) will need to be correctly set
You can run the script directly on an object using "Execute server script" to check whats going on.
I suggest adding this into the foreach loop to make debug easier:
Code Select
println("Type: " . p->type . " Name: " . p->name);