ronaldoguedess Posted January 3, 2014 Share Posted January 3, 2014 Good evening, I'm having trouble at line 12 of my code. you guys should be simple thing, I can not merge the elements using pedcol and ped, the problem is that because of the ped that is created in another function, has somehow I use the ped that was created in another function and use attachElements to join the "ColSphere" and the "PED"? tried using getElementModel (source), and the getElementData (source) and neither worked! Error on line 15 "but it's on the line 12; :15 : Bad arguments @ attachElements' [Expected element at argument 2, got number '68'] function createPedForPlayer(x, y, z) local ped = createPed ( 3 ,x, y,z) end setTimer(createPedForPlayer, 3000, 0) function pedKilled(killer, headshot, attacker, attackerweapon, bodypart, loss ) local ped = getElementModel(source) local pedCol = createColSphere(x, y, z, 1.5) attachElements(pedCol, ped, 0, 0, 0) end addEvent("onPedGetsKilled", true) addEventHandler("onPedGetsKilled", getRootElement(), pedKilled) Link to comment
WASSIm. Posted January 3, 2014 Share Posted January 3, 2014 argument 2 "attachElements" is element Link to comment
ronaldoguedess Posted January 3, 2014 Author Share Posted January 3, 2014 yeah, I do not know what the correct function to use to get the PED already done. local ped = getElementModel (source) Link to comment
WASSIm. Posted January 3, 2014 Share Posted January 3, 2014 this get ped model (ID skin). change this attachElements(pedCol, ped, 0, 0, 0) to attachElements(pedCol, source) Link to comment
ronaldoguedess Posted January 3, 2014 Author Share Posted January 3, 2014 No words to thank you, gave just right. I swear I had already tried with the source. Thank you! Link to comment
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