Hello, for some reason when I am trying to create a ped and attach it to the players hand it doesn’t work.
No Ped is created and no errors in the console.
RegisterNetEvent("fishing:anim", function()
local playerPed = PlayerPedId()
local pPos = GetEntityCoords(playerPed)
local fishHash = "a_c_fish"
theFishObj = CreatePed(28,fishHash, pPos.x, pPos.y, pPos.z, 0, false, true)
SetEntityCollision(theFishObj , false)
SetEntityVisible(theFishObj, true, 0)
AttachEntityToEntity(theFishObj, playerPed, GetPedBoneIndex(playerPed, 57005), 0.15, 0.05, 0.0, -65.0, 0.0, 0.0, 1, 1, 0, 0, 2, 1)
TaskTurnPedToFaceEntity(ped, playerPed, 1.0)
TaskTurnPedToFaceEntity(playerPed, ped, 1.0)
Wait(1000)
PlayAmbientSpeech1(ped, "Generic_Hi", "Speech_Params_Force")
Wait(1000)
FreezeEntityPosition(playerPed, true)
RequestAnimDict("mp_safehouselost@")
while not HasAnimDictLoaded("mp_safehouselost@") do Wait(0) end
TaskPlayAnim(playerPed, "mp_safehouselost@", "package_dropoff", 8.0, 1.0, -1, 16, 0, 0, 0, 0)
Wait(4000)
DeletePed(theFishObj)
SetModelAsNoLongerNeeded(theFishObj)
PlayAmbientSpeech1(ped, "Chat_State", "Speech_Params_Force")
Wait(500)
RequestAnimDict("mp_safehouselost@")
while not HasAnimDictLoaded("mp_safehouselost@") do Wait(0) end
TaskPlayAnim(ped, "mp_safehouselost@", "package_dropoff", 8.0, 1.0, -1, 16, 0, 0, 0, 0 )
Wait(3000)
FreezeEntityPosition(playerPed, false)
end)
