Jump to content

Moving Ped and marker


Axel

Recommended Posts

Posted

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) 

Posted

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

CiTLh.png
Posted
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 :P

CiTLh.png
Posted

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 )

;)

Sometimes I dream about cheese

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...