Hi everyone is there anyway to stop weapon attachments being removed in certain situations and same for accepting attachments. Thanks![]()
Solved Block removing attachments from weapon?
Discussion in 'Rust Development' started by 4lex, Dec 7, 2016.
-
Calytic Community Admin Community Mod
Yes. As far as I know, weapons are containers, therefore OnItemAddedToContainer and OnItemRemovedFromContainer should allow you to accomplish what you want generally.
-
how do check if the container is one of a weapon?
[DOUBLEPOST=1481148475][/DOUBLEPOST]nvm I figured it out
Code:if (container.parent.info.category == ItemCategory.Weapon) { Puts("container is gun"); }
Last edited by a moderator: Dec 7, 2016 -
-
So how would I flag the item contents of the weapon?
[DOUBLEPOST=1486291561][/DOUBLEPOST]i found itCode:item.contents.SetLocked(true);