# [V|REL|HOOK] LUA Plugin for Script Hook V

## Recommended Posts

Wait for the next update which I will release with my extended cheat codes which also includes vehicle spawning

local Zombie = {}
Zombie.peds = {}
Zombie.howMany = 0
end

function Zombie.tick()

if(get_key_pressed(117)) then
local playerPed = PLAYER.PLAYER_PED_ID()
local player = PLAYER.GET_PLAYER_PED(playerPed)
local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
local Table,Count = PED.GET_PED_NEARBY_PEDS(PLAYER.PLAYER_PED_ID(), 55.0, 1)

for k,v in ipairs(Table) do

PED.SET_PED_AS_ENEMY(v, true)
PED.SET_CAN_ATTACK_FRIENDLY(playerPed,true,true)
PED.SET_PED_COMBAT_ABILITY(v, 2)
PED.SET_PED_COMBAT_RANGE(v, 500)
end

end

end

return Zombie

tick: scripts/addins/riftmodule.lua:10: error in function 'GET_PED_NEARBY_PEDS'.

argument #1 is 'nil'; 'number' expected.

it either crashes or doesnt work

Try that

local Zombie = {}
Zombie.peds = {}
Zombie.howMany = 0
end
function Zombie.tick()
if(get_key_pressed(117)) then
local playerPed = PLAYER.PLAYER_PED_ID()
local player = PLAYER.GET_PLAYER_PED(playerPed)
local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
local Table,Count = PED.GET_PED_NEARBY_PEDS(player, 0, 1)
for k,v in ipairs(Table) do
PED.SET_PED_AS_ENEMY(v, true)
PED.SET_CAN_ATTACK_FRIENDLY(player,true,true)
PED.SET_PED_COMBAT_ABILITY(v, 2)
PED.SET_PED_COMBAT_RANGE(v, 500)
end
end
end
return Zombie

##### Share on other sites

Hey, it's Crashing alot and I'm Getting this error message

##### Share on other sites

havent found all yet but i use some in my traindriver mod

Hey, it's Crashing alot and I'm Getting this error message

which has nothing to do with my mod its the .net mod

##### Share on other sites

Hm, I have very dumb question (I'm not a programmer, so all my questions are dumb), is there a left\right shift operator? I'm trying this:

flags = 1 << 8

and magic doesn't happen =\

##### Share on other sites

Hm, I have very dumb question (I'm not a programmer, so all my questions are dumb), is there a left\right shift operator? I'm trying this:

flags = 1 << 8

and magic doesn't happen =\

bit.lshift(1,8)

##### Share on other sites

bit.lshift(1,8)

Thank you very much! And I apologize one more time.

##### Share on other sites

This still doesnt load for me Loads of LUA mods I wanna try but can't , any help would be great, have put LUA.asi in main GTA 5 folder and the scripts folder in same place

##### Share on other sites

This still doesnt load for me Loads of LUA mods I wanna try but can't , any help would be great, have put LUA.asi in main GTA 5 folder and the scripts folder in same place

Use this version it seems to be bug free from what i can tell.

##### Share on other sites

This still doesnt load for me Loads of LUA mods I wanna try but can't , any help would be great, have put LUA.asi in main GTA 5 folder and the scripts folder in same place

Use this version it seems to be bug free from what i can tell.

Still failing for me

##### Share on other sites

This still doesnt load for me Loads of LUA mods I wanna try but can't , any help would be great, have put LUA.asi in main GTA 5 folder and the scripts folder in same place

Use this version it seems to be bug free from what i can tell.

Still failing for me

any errors in the log?

##### Share on other sites

This still doesnt load for me Loads of LUA mods I wanna try but can't , any help would be great, have put LUA.asi in main GTA 5 folder and the scripts folder in same place

Use this version it seems to be bug free from what i can tell.

Still failing for me

any errors in the log?

thats the log from asi loader

// GTA V ASI LOADER (build Apr 22 2015)
LIB: "C:\Windows\system32\dsound.dll" => 00007FFB7A440000
API: "DirectSoundCreate" => 00007FFB7A468050
API: "DirectSoundEnumerateA" => 00007FFB7A468150
API: "DirectSoundEnumerateW" => 00007FFB7A445620
API: "DllGetClassObject" => 00007FFB7A446DF0
API: "DirectSoundCaptureCreate" => 00007FFB7A467F30
API: "DirectSoundCaptureEnumerateA" => 00007FFB7A468030
API: "DirectSoundCaptureEnumerateW" => 00007FFB7A452770
API: "GetDeviceID" => 00007FFB7A449920
API: "DirectSoundFullDuplexCreate" => 00007FFB7A468170
API: "DirectSoundCreate8" => 00007FFB7A44C7C0
API: "DirectSoundCaptureCreate8" => 00007FFB7A450B50
"HeistVeh.asi" => 00007FFB852D0000
"jedijosh920.asi" => 00007FFB7B6A0000
"PedSpawner.asi" => 00007FFB839B0000
"VehicleController.asi" => 00007FFB7C930000
##### Share on other sites

you got to install vc2013 x64 redist

##### Share on other sites

I go too the link and download but when it tells me too install, it just says repair or unistall ?

##### Share on other sites

Got it working thanks guys

##### Share on other sites

I have been using

float VEHICLE:GET_VEHICLE_DIRT_LEVEL(v) -- value 0..15

and

VEHICLE:SET_VEHICLE_DIRT_LEVEL(v, float)

in a script recently and they were working fine.

Now VEHICLE:GET_VEHICLE_DIRT_LEVEL seems to have stopped returning a float and returns a large integer.

I have reverted to the previous working version of my script and it still doesn't return a float.

example

platetxt = VEHICLE.GET_VEHICLE_NUMBER_PLATE_TEXT(v)dirtlevel = VEHICLE.GET_VEHICLE_DIRT_LEVEL(v)print("Vehicle " .. platetxt .. " Dirt Level " .. VEHICLE.GET_VEHICLE_DIRT_LEVEL(v) .. " - " .. dirtlevel)

produces..

Vehicle 07VIA999 Dirt Level 1088421888 - 1088421888

I did update both scripthookv and the lua plugin the other day, but I can't remember if it worked since I updated them?

##### Share on other sites

how do i remove the menu from the top left corner

##### Share on other sites

how do i remove the menu from the top left corner

remove my .lua files from the scripts folder if you use the sdk

##### Share on other sites

I got an error at this line:

for mod in io.popen([[dir "scripts/libs/" /b ]]):lines() do

in main.lua

Do you know why?

Any suggestion?

##### Share on other sites

Hey guys, is anyone able to run VEHICLE.GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX()?

It returns an error for me: attempt to call field 'GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX' (a nil value)

It seems the guys calling it from C++ aren't having any problems, so I think the problem is on lua side. I don't have MSVS installed atm to test.

##### Share on other sites

I have the same problem with VEHICLE.SET_MOD_KIT(veh,0) comes up with a nil value

##### Share on other sites

Hey all, do we have a working Delete Object LUA script working (or even C++)? I'd like to create an object/ped/vehicle spawning tool but would rather create only one instance of it at a time (while browsing the objects) - the DELETE_OBJECT native does not delete it right away. Thanks.

##### Share on other sites

Can anyone help me find the natives for creating a playername etc. above a players head? I'm working on some stuff for FiveM.

##### Share on other sites

Can anyone help me find the natives for creating a playername etc. above a players head? I'm working on some stuff for FiveM.

Tried already and I'm also working on fiveM
##### Share on other sites

Can anyone help me find the natives for creating a playername etc. above a players head? I'm working on some stuff for FiveM.

Tried already and I'm also working on fiveM

Hey Headscript, any ideas on VEHICLE.GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX()?
##### Share on other sites

Can anyone help me find the natives for creating a playername etc. above a players head? I'm working on some stuff for FiveM.

Tried already and I'm also working on fiveM

Hey Headscript, any ideas on VEHICLE.GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX()?

write me a pm with your skypename and we can work it together out ^^

##### Share on other sites

my console is not refreshing

##### Share on other sites

local tele_key = {}local save_pressed=falselocal load_pressed=falselocal player = PLAYER.PLAYER_PED_ID()local player_position = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.0, 0.0, 1.0)function tele_key.unload()endfunction tele_key.init()endfunction tele_key.tick()	if(get_key_pressed(Keys.B))then		save_pressed = true	elseif save_pressed then		save_pressed=false		player_position = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.0, 0.0, 1.0)	end	if(get_key_pressed(Keys.N))then		load_pressed = true	elseif load_pressed then		load_pressed=false		ENTITY.SET_ENTITY_COORDS_NO_OFFSET(player, player_position.x, player_position.y, player_position.z, 0.0, 0.0, 1.0);	end	endreturn tele_key

Could someone help me with this code? I am a total noob and trying to create a simple script to save and load the player position.

Other LUA scripts work but this just doesnt do anything.

Is there a log file?

##### Share on other sites

local tele_key = {}local save_pressed=falselocal load_pressed=falselocal player = PLAYER.PLAYER_PED_ID()local player_position = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.0, 0.0, 1.0)function tele_key.unload()endfunction tele_key.init()endfunction tele_key.tick()	if(get_key_pressed(Keys.B))then		save_pressed = true	elseif save_pressed then		save_pressed=false		player_position = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.0, 0.0, 1.0)	end	if(get_key_pressed(Keys.N))then		load_pressed = true	elseif load_pressed then		load_pressed=false		ENTITY.SET_ENTITY_COORDS_NO_OFFSET(player, player_position.x, player_position.y, player_position.z, 0.0, 0.0, 1.0);	end	endreturn tele_key

Could someone help me with this code? I am a total noob and trying to create a simple script to save and load the player position.

Other LUA scripts work but this just doesnt do anything.

Is there a log file?

no logfile but errors come up in the console

also you should get the playersposition every tick / or before you save it as i just see

## Create an account

Register a new account

×