• SetParent problem
    2 replies, posted
Hello, i'm working on script and on one of testing i had a problem.. I have Parented entity to another entity, but it have no parent when i check it with console, i have checked it with lua, after function, it HAS parent but on next tick of the server parent wen off... So i parented it through console in game, parent work... So problem is not in my function or on server think functions... I can't understand why it deparents.... What it can be? I want parent prop_dynamic_override to weapon_flashbang, both have names, so i used them in parenting like that: [CODE] local function ParentEntity( ent, par ) table.GetFirstValue(ents.FindByName(ent)):SetParent(table.GetFirstValue(ents.FindByName(par))) return true end [/CODE]
Can you be more clear about what you mean and provide full code instead of some minor part.
I found the problem... My script work with entities names, this entity was created after remove one with the same name. Idk why needs to delete targetname value of entity before remove it, but it works now, i have script, witch load new entities from file/edit current entities on the map.
Sorry, you need to Log In to post a reply to this thread.