hello guys, i’m trying to attach a weapon MG in the back of the vehicle and with the same rotation by that i mean the weapon mezzle should be in the front not looking for the left side like this
i tried to get the vehicle rotation and apply it when attaching the entitys in this way:-
RegisterCommand("createweapon", function()
local weapon_hash = -1660422300
RequestWeaponAsset(weapon_hash)
while not HasWeaponAssetLoaded(weapon_hash) do
Citizen.Wait(1)
end
local Vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), true)
local VehicleCoords = GetEntityCoords(Vehicle)
local VehicleRot = GetEntityRotation(Vehicle)
local Weapon = CreateWeaponObject(weapon_hash, 100.0, VehicleCoords, true, 1.5,0)
AttachEntityToEntity(Weapon, Vehicle, 0, 0, -2.1, 1.5, VehicleRot, false, false)
end)
and there is somthing else, i want to set the weapon in the back of the truck without moving when the vehicle moves so how can i make this?
screenshot.gif
