Potato_Tomato420 Posted December 10, 2017 Posted December 10, 2017 Is it possible to clear/remove the setElementParent? function onVehAttach(towTruck) setElementParent ( towTruck, source ) outputChatBox ("Debug Line") end addEventHandler("onTrailerAttach", getRootElement(), onVehAttach) function onVehDetach(towTruck) clearElementParent ( towTruck, source ) -- I know this function doesn't exist but it's just a example. end addEventHandler("onTrailerDetach", getRootElement(), onVehDetach)
Potato_Tomato420 Posted December 10, 2017 Author Posted December 10, 2017 Doesn't work.. Debug says on vehicle detach: Bad argument @ 'setElementParent' [Expected element at argument 2, got nil]
MisterQuestions Posted December 10, 2017 Posted December 10, 2017 Use root element as parent or resourceRoot or getResourceDynamicElementRoot(resource), see what one meets your needs
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now