Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

headscript

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

Recommended Posts

headscript

Thanks Headscript!

 

PS: Not to offend but it'll be nice if you can make your code readable.

 

Edit:

 

I can help you with that if you want help if you're going to make it readable.

 

 

 

 

I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value"

 

Even without the code it still has that error. This only happened since I've updated the Lua SDK.

 

Please help.

 

Thanks.

 

With Code:

 

 

function bodyguardScript.unload()  for k, guard in pairs(guards) do    if (guard ~= nil) then      PED.DELETE_PED(guard)      guards[k] = nil      bodyguardCount = 0    end  endend

 

 

 

Without code still causes that error:

 

 

function bodyguardScript.unload()end

 

 

and you Sir just found a bug :) (no actually i forogt to update the main.lua in the zip sorry)

 

headscript does this work with the new ScripthookV?

yes apart from the bug mentioned above which i will fix instantly

 

-Fixed just redownload it -

 

 

 

i have nothing against help :) would be nice if you would make it readable

Share this post


Link to post
Share on other sites
Foul_Play

Sure! What files need making readable?

 

 

 

 

 

Thanks Headscript!

 

PS: Not to offend but it'll be nice if you can make your code readable.

 

Edit:

 

I can help you with that if you want help if you're going to make it readable.

 

 

 

 

I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value"

 

Even without the code it still has that error. This only happened since I've updated the Lua SDK.

 

Please help.

 

Thanks.

 

With Code:

 

 

function bodyguardScript.unload()  for k, guard in pairs(guards) do    if (guard ~= nil) then      PED.DELETE_PED(guard)      guards[k] = nil      bodyguardCount = 0    end  endend

 

 

 

Without code still causes that error:

 

 

function bodyguardScript.unload()end

 

 

and you Sir just found a bug :) (no actually i forogt to update the main.lua in the zip sorry)

 

headscript does this work with the new ScripthookV?

yes apart from the bug mentioned above which i will fix instantly

 

-Fixed just redownload it -

 

 

 

i have nothing against help :) would be nice if you would make it readable

 

 

Share this post


Link to post
Share on other sites
headscript

Sure! What files need making readable?

 

 

 

 

 

Thanks Headscript!

 

PS: Not to offend but it'll be nice if you can make your code readable.

 

Edit:

 

I can help you with that if you want help if you're going to make it readable.

 

 

 

 

I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value"

 

Even without the code it still has that error. This only happened since I've updated the Lua SDK.

 

Please help.

 

Thanks.

 

With Code:

 

 

function bodyguardScript.unload()  for k, guard in pairs(guards) do    if (guard ~= nil) then      PED.DELETE_PED(guard)      guards[k] = nil      bodyguardCount = 0    end  endend

 

 

 

Without code still causes that error:

 

 

function bodyguardScript.unload()end

 

 

and you Sir just found a bug :) (no actually i forogt to update the main.lua in the zip sorry)

 

headscript does this work with the new ScripthookV?

yes apart from the bug mentioned above which i will fix instantly

 

-Fixed just redownload it -

 

 

 

i have nothing against help :) would be nice if you would make it readable

 

 

gui.lua main.lua for now

Share this post


Link to post
Share on other sites
Foul_Play

Sure, I'll get working on it tomorrow when I'm back to my house.

 

 

 

Sure! What files need making readable?

 

 

 

 

 

Thanks Headscript!

 

PS: Not to offend but it'll be nice if you can make your code readable.

 

Edit:

 

I can help you with that if you want help if you're going to make it readable.

 

 

 

 

I don't know if it is my script or it is the Lua SDK because I'm getting this error: "unload: attempt to call a nil value"

 

Even without the code it still has that error. This only happened since I've updated the Lua SDK.

 

Please help.

 

Thanks.

 

With Code:

 

 

function bodyguardScript.unload()  for k, guard in pairs(guards) do    if (guard ~= nil) then      PED.DELETE_PED(guard)      guards[k] = nil      bodyguardCount = 0    end  endend

 

 

 

Without code still causes that error:

 

 

function bodyguardScript.unload()end

 

 

and you Sir just found a bug :) (no actually i forogt to update the main.lua in the zip sorry)

 

headscript does this work with the new ScripthookV?

yes apart from the bug mentioned above which i will fix instantly

 

-Fixed just redownload it -

 

 

 

i have nothing against help :) would be nice if you would make it readable

 

 

gui.lua main.lua for now

 

 

Share this post


Link to post
Share on other sites
Royalgamer06

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?

Share this post


Link to post
Share on other sites
diamond-optic

anyone able to get STAT_GET_INT to work for getting player cash? Im able to set player cash with STAT_SET_INT, but cant get the current cash value...

 

quite likely Im doing this wrong, as its been quite a long time since I did anything like this and the last language I worked with heavily was pawn..

 

 

 

 

local character = 1
-- 0: michael
-- 1: franklin
-- 2: trevor

print("-----------------------")
print("char: ", character)

local hashname = string.format("SP%d_TOTAL_CASH", character)
print("name: ", hashname)

local hash = GAMEPLAY.GET_HASH_KEY(hashname)
print("hash: ", hash)

local oldcash = 0
STATS.STAT_GET_INT(hash, oldcash, -1)

local newcash = oldcash + 100
STATS.STAT_SET_INT(hash, newcash, true)

print("old: ", oldcash)
print("new: ", newcash)
print("-----------------------")

 

 

 

it always just sets the cash to the 100

Edited by diamond-optic

Share this post


Link to post
Share on other sites
mitterdoo

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

Edited by mitterdoo

Share this post


Link to post
Share on other sites
xsploit
local Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do    print("Give Weapon to "..v)    WEAPON.GIVE_DELAYED_WEAPON_TO_PED(v, GAMEPLAY.GET_HASH_KEY("WEAPON_RAILGUN"), 1000, false)end

Does this work for everybody?

Share this post


Link to post
Share on other sites
headscript

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

 

it should not show me your code

 

for example getfenv or loadstring does not work.

which are both no Lua 5.2 functions?

quote from Wiki

Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues.

print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())
Edited by headscript

Share this post


Link to post
Share on other sites
xsploit

 

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

 

it should not show me your code

 

for example getfenv or loadstring does not work.

which are both no Lua 5.2 functions?

quote from Wiki

Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues.

print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra

it crashes for me no matter what all i want to do was player._set_player_model

they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run

Edited by xsploit

Share this post


Link to post
Share on other sites
headscript

 

 

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

 

it should not show me your code

 

for example getfenv or loadstring does not work.

which are both no Lua 5.2 functions?

quote from Wiki

Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues.

print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra

it crashes for me no matter what all i want to do was player._set_player_model

they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run

 

PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash)

show me what u did if that doesnt work

Share this post


Link to post
Share on other sites
xsploit

 

 

 

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

 

it should not show me your code

 

for example getfenv or loadstring does not work.

which are both no Lua 5.2 functions?

quote from Wiki

Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues.

print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra

it crashes for me no matter what all i want to do was player._set_player_model

they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run

 

PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash)

show me what u did if that doesnt work

 

ilocal Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do    print("Give Weapon to "..v)    PLAYER.SET_PLAYER_MODELend

I guess player only refers to the local player

Edited by xsploit

Share this post


Link to post
Share on other sites
headscript

 

 

 

 

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

 

it should not show me your code

 

for example getfenv or loadstring does not work.

which are both no Lua 5.2 functions?

quote from Wiki

Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues.

print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra

it crashes for me no matter what all i want to do was player._set_player_model

they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run

 

PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash)

show me what u did if that doesnt work

 

ilocal Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do    print("Give Weapon to "..v)    PLAYER.SET_PLAYER_MODELend

I guess player only refers to the local player

 

player refers to all players in the lobby

others are Ped's

Share this post


Link to post
Share on other sites
xsploit

 

 

 

 

 

does anybody know why some lua functions aren't here?

for example getfenv or loadstring does not work.

need loadstring for a lua prompt so i can mess around and also possibly reload a script

 

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

edit: io.read freezes gta v sadly.. do you think that you could add something like that so it's easier to debug and whatnot?

 

it should not show me your code

 

for example getfenv or loadstring does not work.

which are both no Lua 5.2 functions?

quote from Wiki

Lua 5.2 deprecates loadstring in favor of the existing load function, which has been augmented to accept strings. In addition, it allows providing the function's environment directly, as environments are now upvalues.

print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())it cra

it crashes for me no matter what all i want to do was player._set_player_model

they are making it hard to do anything, in the console version you could change a meta file and get everyone the same model.....then you try the other way create ped...but when you point a weapon at the zombie model they run

 

PLAYER.SET_PLAYER_MODEL(PLAYER.PLAYER_ID(),modelhash)

show me what u did if that doesnt work

 

ilocal Table,Count = PED.GET_PED_NEARBY_PEDS(playerPed, 0, -1) for k,v in ipairs(Table) do    print("Give Weapon to "..v)    PLAYER.SET_PLAYER_MODELend

I guess player only refers to the local player

 

player refers to all players in the lobby

others are Ped's

 

thanks maybe i'll try CHANGE_PLAYER_PED if i cant get the params right if not figure out how to get the zombie model to attack ppl with guns

Share this post


Link to post
Share on other sites
ILS_Supernova

Can someone help please, Ive installed everything in right place and all required items but get failed to load in asi.loader!

Share this post


Link to post
Share on other sites
lilw

There is vehicles spawn in old script. But now with the new one, I can't spawn it any more. I don't have any knowledge to using this.

Share this post


Link to post
Share on other sites
headscript

There is vehicles spawn in old script. But now with the new one, I can't spawn it any more. I don't have any knowledge to using this.

local playerPed = PLAYER.PLAYER_PED_ID()	local pedPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)	local hash = GAMEPLAY.GET_HASH_KEY(vehicle)	STREAMING.REQUEST_MODEL(hash)	local executionBreaker = 0	while( not STREAMING.HAS_MODEL_LOADED(hash) and executionBreaker< 50)do		wait(0)		executionBreaker= executionBreaker +1	end	local veh  = VEHICLE.CREATE_VEHICLE(hash, pedPosition.x,pedPosition.y,pedPosition.z, 0, false, false)	PED.SET_PED_INTO_VEHICLE(playerPed,veh,-1)

Share this post


Link to post
Share on other sites
Foul_Play

Mr HeadScript, I've done the main.lua file for you.

 

Also I've changed "addins" to addons and bug tested it.

The reason I've changed it because "addins" doesn't sound good.

To load custom scripts, they now go in the "addons" folder.

I've changed the prints to make it easier for you and other modders to read.

 

The function that prints in console "Loaded main.lua" needs a "\n" at the end so the console can make a new line.

 

Is there anyway to send you the file?

 

PS: I'm going to start working on gui.lua when I can.

 

 

 

XLtuuyh.png

 

Share this post


Link to post
Share on other sites
headscript

Mr HeadScript, I've done the main.lua file for you.

 

Also I've changed "addins" to addons and bug tested it.

The reason I've changed it because "addins" doesn't sound good.

To load custom scripts, they now go in the "addons" folder.

I've changed the prints to make it easier for you and other modders to read.

 

The function that prints in console "Loaded main.lua" needs a "\n" at the end so the console can make a new line.

 

Is there anyway to send you the file?

 

PS: I'm going to start working on gui.lua when I can.

 

 

 

XLtuuyh.png

 

stay with addins i have reserved addons for a different functionality already^^ and thank you very much

just add me on skype or something (fabs1996)

Edited by headscript

Share this post


Link to post
Share on other sites
Foul_Play

Okay, can you PM me where you're from because I found someone with that Skype name and isn't from Germany.

 

Also I'll change "addons" to "addins" now.

 

 

 

 

Mr HeadScript, I've done the main.lua file for you.

 

Also I've changed "addins" to addons and bug tested it.

The reason I've changed it because "addins" doesn't sound good.

To load custom scripts, they now go in the "addons" folder.

I've changed the prints to make it easier for you and other modders to read.

 

The function that prints in console "Loaded main.lua" needs a "\n" at the end so the console can make a new line.

 

Is there anyway to send you the file?

 

PS: I'm going to start working on gui.lua when I can.

 

 

 

XLtuuyh.png

 

stay with addins i have reserved addons for a different functionality already^^ and thank you very much

just add me on skype or something (fabs1966)

 

 

 

Share this post


Link to post
Share on other sites
headscript

The member Foul_Play can not use the messaging system

and my name is fabs1996 sorry

Share this post


Link to post
Share on other sites
ILS_Supernova

Can someone please try help me? Trying to install this as I wanna try some scripts out but the asi,loader says this,

 

ASI: Loading "C:\Program Files\Rockstar Games\Grand Theft Auto V\LUA.asi"
"LUA.asi" failed to load

Share this post


Link to post
Share on other sites
Foul_Play

Did it fix it?

Share this post


Link to post
Share on other sites
ffzero58

 

Thanks now i have to make a delete script

 

 

 

Have you made a working delete script? Using DELETE_OBJECT does not remove it straight away.

 

Also, it seems some of the objects only spawn when they are in the right area of the map. Have you seen something similar?

Share this post


Link to post
Share on other sites
sakis25

Is it possible to check what weapon is the player currently holding and then lose ammo of that weapon by a key press?

I'm trying GET_CURRENT_PED_WEAPON but I'm getting a "nil" error.

Share this post


Link to post
Share on other sites
xsploit
local Zombie = {}Zombie.peds = {}Zombie.howMany = 0function Zombie.unload()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

Share this post


Link to post
Share on other sites
lilw

 

There is vehicles spawn in old script. But now with the new one, I can't spawn it any more. I don't have any knowledge to using this.

local playerPed = PLAYER.PLAYER_PED_ID()	local pedPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)	local hash = GAMEPLAY.GET_HASH_KEY(vehicle)	STREAMING.REQUEST_MODEL(hash)	local executionBreaker = 0	while( not STREAMING.HAS_MODEL_LOADED(hash) and executionBreaker< 50)do		wait(0)		executionBreaker= executionBreaker +1	end	local veh  = VEHICLE.CREATE_VEHICLE(hash, pedPosition.x,pedPosition.y,pedPosition.z, 0, false, false)	PED.SET_PED_INTO_VEHICLE(playerPed,veh,-1)

Thanks, but where should I put it in? I create new file with name veh.lua, try add "function" and other thing, but don't know how to make it loads. it always said "a nil value". Sorry, I'm freaking noob

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.