Hello facepunch. I am trying to get vectors for passenger seats (making some vehicles). I figured out how to set the vehicle’s angles to 0 0 0, but now I need to get the seat pos. I amde this script
function FindPlayer ( string ) local i = 0 local ply for k, v in pairs ( player.GetAll() ) do if string.find ( string.lower ( v:Name() ), string.lower ( string ) ) then i = i + 1 ply = v end end if ! i==1 then ply = NULL end return ply end function Nig( ply, cmd ) Entity:IsValid then MsgN ( ply:WorldToLocal( Vector ( tr.Entity ))) end concommand.Add("getpos1", Nig )
As you can probably see, I don’t know how to make the script find the needed entity. I tried player eye tracelines, but failed. The position script gives me is counted from the center of the map, while I need to make WorldToLocal count it from the center of the car. Please help, I ran out of ideas.