Reply To: Mafia 3 Modding (Mega Thread)

Download Mods for the Mafia Games Forums Mod Creation Mafia 3 Modding (Mega Thread) Reply To: Mafia 3 Modding (Mega Thread)

#164835
discohouse57
Participant

I want to spawn Vito near the player.
In Mafia 2, you could do this:

Vito = game.entitywrapper:GetEntityByName("Vito")
Vito:SetPos(game.game:GetActivePlayer():GetPos())

In M3, this does not work, although function GetEntityByName is present: mafia3scripting.wikia.com/wiki/Game_Library

Is there any idea how this can be done?

 

P.S. Error description in ScriptHook.log:

Error loading Lua code into buffer. Error -100
test:2: attempt to index a nil value
stack traceback:
test:2: in function ‘(main chunk)’
Trying to execute: Vito = game.entitywrapper:GetEntityByName(“Vito”)