Axel Posted August 18, 2011 Posted August 18, 2011 So i want to attach a pickup to a Ped and using a walk animation, the pickup to move with the ped. taxiped = createPed(187,1220,-1812,16,0) setPedRotation(taxiped,180) setPedAnimation( taxiped, "ped", "WOMAN_walknorm") tpickup = createPickup (-2026.5, -101, 35.5, 3, 1239, 1 ) attachElements(taxiped,tpickup)
TAPL Posted August 18, 2011 Posted August 18, 2011 attachElements is not compatible with all elements is only compatible with Markers and Blips and Objects and Players and Vehicles and Pickup is not compatible
Axel Posted August 18, 2011 Author Posted August 18, 2011 Is there another way to do it? A ped walking with a marker infront of him looks strange..
TAPL Posted August 18, 2011 Posted August 18, 2011 function attach() taxiped = createPed(187,1220,-1812,16,0) setPedRotation(taxiped,180) setPedAnimation( taxiped, "ped", "WOMAN_walknorm") tpickup = createPickup (-2026.5, -101, 35.5, 3, 1239, 1 ) setTimer(function() local x,y,z = getElementPosition( taxiped) setElementPosition(tpickup, x, y, z) end, 50, 0) end addCommandHandler ( "ped", attach ) i don't know if there an other way but this will work
denny199 Posted August 18, 2011 Posted August 18, 2011 Well, this should be better if you meaning this: taxiped = createPed(187,1220,-1812,16,0) setPedRotation(taxiped,180) setPedAnimation( taxiped, "ped", "WOMAN_walknorm") tpickup = createPickup (-2026.5, -101, 35.5, 3, 1239, 1 ) attachElements(tpickup, taxiped) ^^ You was trying to attach a ped to a object, and that can't:attachElements(taxiped, tpickup )
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