Jump to content

element parent resourceRoot


Fabioxps

Recommended Posts

it is possible to define this parent
 

setElementParent(player,resourceRoot) --server



addCommandHandler("a",function()
    for id, element in pairs(getElementChildren(resourceRoot)) do
        outputChatBox(type(element))-- not return
    end
end)

 

Link to comment

I would strongly suggest you to avoid using that. Instead, you can create a dummy element and set it as parent for players that you wish to retrieve later using getElementChildren.

local moderatorElement = createElement( "moderator", "admin" )
if moderatorElement then
    for _, v in pairs ( getElementsByType ( "player" ) ) do 
        setElementParent ( v, moderatorElement )
    end
end

addCommandHandler("a",
function()
    for id, element in pairs ( getElementChildren ( moderatorElement ) ) do
        outputChatBox ( type ( element ) )
    end
end
)

 

  • Thanks 1
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...