I am using a Police job where the Police/Civilians can escort people with a command. Now the thing is whenever a person is escorted, everything works fine. He gets attached to the officer and/or civilian who used the Escort command.
But when we move with the escorted person and get near a wall or a wired wall like we have in Jail area. The escorted person can go through the other side…like a noclip glitch. Don’t know exactly what I am doing wrong… Any idea how to fix?
Here is the code snippet.
if not isEscorted then
isEscorted = true
draggerId = playerId
local dragger = GetPlayerPed(GetPlayerFromServerId(playerId))
local heading = GetEntityHeading(dragger)
SetEntityCoords(GetPlayerPed(-1), GetOffsetFromEntityInWorldCoords(dragger, 0.0, 0.45, 0.0))
AttachEntityToEntity(GetPlayerPed(-1), dragger, 11816, 0.45, 0.45, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true)
else
isEscorted = false
DetachEntity(GetPlayerPed(-1), true, false)
end
Here are the screenshots