ronaldoguedess Posted January 3, 2014 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)
ronaldoguedess Posted January 3, 2014 Author 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)
WASSIm. Posted January 3, 2014 Posted January 3, 2014 this get ped model (ID skin). change this attachElements(pedCol, ped, 0, 0, 0) to attachElements(pedCol, source)
ronaldoguedess Posted January 3, 2014 Author Posted January 3, 2014 No words to thank you, gave just right. I swear I had already tried with the source. Thank you!
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