3 New Notifications

New Badge Earned
Get 1K upvotes on your post
Life choices of my cat
Earned 210

Drag Images here or Browse from your computer.

Trending Posts
Sorted by Newest First
J
JackSnow 12.03.22 04:31 am

How to make NPC drive without \"entity\" (Mafia 2)

you need a four door car, from the garage or from traffic,
the presence of Henry and that he does not follow the GG.

-- 1, so the GG must get into the car, click on the script so that the NPC gets into the car
DelayBuffer:Insert(
function(l_1_0)
playerCar = game.game:GetActivePlayer():GetOwner()
-- game.entitywrapper:GetEntityByName( "Henry "):AnimStop()
game.entitywrapper:GetEntityByName( "Henry"):GetInOutCar( playerCar, 4, false, false)
end,{},1,1,false)


-- 2, GM must vacate driver's seat, click on script for GG to sit in the back seat
DelayBuffer:Insert(
function(l_1_0)
player = game.game:GetActivePlayer()
player:LockControls(true)
player:GetInOutCar( game.entitywrapper:GetEntityByName( "Henry"):GetOwner(), 3, false, false)
player:LockControls(false)
end,{},1,1,false)


-- 3, click on script to
NPC left the passenger seat
_ },1,1,false) -- 4, click on the script to make the NPC sit in the driver's seat DelayBuffer:Insert( function(l_1_0) playerCar = game.game:GetActivePlayer():GetOwner() game.entitywrapper:GetEntityByName( "Henry "):GetInOutCar( playerCar, 1, false, true) end,{},1,1,false)













-- 5, let's go!!!
DelayBuffer:Insert(
function(l_1_0)
driveCar = game.entitywrapper:GetEntityByName( "Henry"):GetOwner()
driveCar:DestroyController() driveCar:CreateController( "car_escaper") driveCar:InitializeAIParams( enums.CarAIProfile.NORMAL, 0)
driveCar :EscapeMode() drivePos = Math:newVector() drivePos:set( -1541.3704833984, -78.82649230957, -18.380180358887) -- location where NPC will go, "Alcohol Factory"
driveCar:MoveTo(drivePos, START)
end,{},1, 1,false)


-- 5, aggressive driving !!!
DelayBuffer:Insert(
function(l_1_0)
driveCar = game.entitywrapper:GetEntityByName( "Henry"):GetOwner()
driveCar:DestroyController() driveCar:CreateController( "car_escaper") driveCar:InitializeAIParams( enums.CarAIProfile.AGGRESSIVE, 0)
driveCar:EscapeMode() drivePos = Math:newVector() drivePos:set( -1541.3704833984, -78.82649230957, -18.38018035888888888888883) -- place where the NPC will go, "Alcohol plant"
driveCar:MoveTo(drivePos, START)
end,{},1,1,false)
5 Comments
Sort by:
F
Fulkrum 12.03.22

cool but why is that?

J
JackSnow 12.03.22

Vl123
I decided to share information, maybe someone will need it.

J
JackSnow 12.03.22

download injector.

a
agents 12.03.22

JackSnow Come in
handy of course.

J
JackSnow 12.03.22

-- 1, first, the GG must get into the car and then get out.
-- 2, the NPC will sit on any car that the GG has sat on.
DelayBuffer:Insert(
function(l_1_0)
V = game.entitywrapper
npc1 = V:GetEntityByName( "Henry") --
Henry.player = game.game:GetActivePlayer()
npc1:GetInOutCar(V:GetEntityByGUID( game.garage:GetPlayersCar( )), 1, false, false)
player:LockControls(true)
player:GetInOutCar(V:GetEntityByGUID( game.garage:GetPlayersCar()), 2, false, false)
player:LockControls(false)
end,{},1 ,1,false)