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 for this tool, headscript.

 

Could you please explain briefly how to reload the lua files in-game?

main.lua

function init()	local module_folder = "scripts/"	package.path = module_folder .. "?.lua;" .. package.path	GRAPHICS.SET_DEBUG_LINES_AND_SPHERES_DRAWING_ACTIVE(1)endfunction tick()	--print("test")	if(get_key_pressed(115)) then		if (package.loaded.testmodule ~= nil) then			package.loaded.testmodule = nil		end	end		testmodule = require "testmodule"	testmodule.tick()	end

testmodule.lua

local testmodule = {}testmodule.loaded = falsefunction testmodule.tick()	if(not testmodule.loaded) then 		local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")		local playerPed = PLAYER.PLAYER_PED_ID()		local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do				--wait(5) wait function not yet implemented in released version		end		for i = 0 ,10,1 do						PED.CREATE_PED( 26,zombieSkinID,playerPosition.x, playerPosition.y, playerPosition.z,0,true,true)					end		STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(zombieSkinID)		testmodule.loaded = true	end    --print("Hello World! 2")	endreturn testmodule

when you press f4 testmodule.lua is getting reloaded

Share this post


Link to post
Share on other sites
Tusillody

Hello, made an account to share my bit of code, adds feature that if you hit a car, pedestrian, or drive in the oncoming lane you'll get a wanted star. Honk your horn to remove the wanted level. It's very simplistic, feel free to use it as you want, it was my first attempt at making something for myself.

Variables needed

local player = PLAYER.GET_PLAYER_PED(playerPed)local playerPed = PLAYER.PLAYER_PED_ID()local onVehHit = PLAYER.GET_TIME_SINCE_PLAYER_HIT_VEHICLE(player)local onHitPed = PLAYER.GET_TIME_SINCE_PLAYER_HIT_PED(player)local onPavement = PLAYER.GET_TIME_SINCE_PLAYER_DROVE_ON_PAVEMENT(player)local againstTraffic = PLAYER.GET_TIME_SINCE_PLAYER_DROVE_AGAINST_TRAFFIC(player)

Function

			if(PED.IS_PED_IN_ANY_VEHICLE(playerPed, true)) then			print("---")			print(onHitPed/1000, "Seconds since last ped hit")			print(onVehHit/1000, "Seconds since last vehicle hit")			print(onPavement/1000, "Seconds since crossed pavement")			print(againstTraffic/1000, "Seconds since challenged traffic")			print("---")						if (onHitPed < 1000) then			PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)			PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)			end			if (onVehHit < 1000) then			PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)			PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)			end			if(onPavement < 1000) then			--PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true) -- Turned off because annoying			--PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true) -- -- -- -- -- -- -- -- -- --			end			if(againstTraffic < 1000) then			PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)			PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)			end											if(PLAYER.IS_PLAYER_PRESSING_HORN(player)) then								print("beep")								PLAYER.SET_PLAYER_WANTED_LEVEL(player, 0, true)								PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)								print("second beep")											end									end	end

Also, editing the testmodule script automatically reloads it ingame, pretty handy, really love this

I wanted to make use of "or" to make that neater, but i couldn't figure it out, so several "if"s it is

 

edit: Here is my full testmodule with only this script, uses default main.lua

 

 

 

local testmodule = {}function testmodule.tick()	-- variables	local playerPed = PLAYER.PLAYER_PED_ID()	local player = PLAYER.GET_PLAYER_PED(playerPed)	local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local onVehHit = PLAYER.GET_TIME_SINCE_PLAYER_HIT_VEHICLE(player)	local onHitPed = PLAYER.GET_TIME_SINCE_PLAYER_HIT_PED(player)	local onPavement = PLAYER.GET_TIME_SINCE_PLAYER_DROVE_ON_PAVEMENT(player)	local againstTraffic = PLAYER.GET_TIME_SINCE_PLAYER_DROVE_AGAINST_TRAFFIC(player)	-- variables end   	if(playerExists) then				if(PED.IS_PED_IN_ANY_VEHICLE(playerPed, true)) then			print("---")			print(onHitPed/1000, "Ped hit")			print(onVehHit/1000, "Vehicle hit")			print(onPavement/1000, "Pavement")			print(againstTraffic/1000, "Traffic")			print("---")						if (onHitPed < 1000) then			PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)			PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)			end			if (onVehHit < 1000) then			PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)			PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)			end			if(onPavement < 1000) then			--PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true) -- Turned off because driving 			--PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true) -- into alleys shouldn't want you			end			if(againstTraffic < 1000) then			PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)			PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)			end											if(PLAYER.IS_PLAYER_PRESSING_HORN(player)) then								print("beep")								PLAYER.SET_PLAYER_WANTED_LEVEL(player, 0, true)								PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)								print("second beep")											end									end	endendreturn testmodule

 

 

Edited by Tusillody

Share this post


Link to post
Share on other sites
Swarm96

This doesnt seem to work. I replaced the x, y,z with my coords.x, etc. But nothing spawns.

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

Share this post


Link to post
Share on other sites
xsploit

i can't get createped to work at all

Share this post


Link to post
Share on other sites
larperdoodle

Anyone know how to use this function? I assume the arguments it takes have something to do with defining the diameter of the sphere or something?

 

VEHICLE::GET_RANDOM_VEHICLE_IN_SPHERE

Hash: 0x57216D03

Any GET_RANDOM_VEHICLE_IN_SPHERE(Any p0, Any p1, Any p2, Any p3,
Any p4, Any p5) // 0x57216D03

Share this post


Link to post
Share on other sites
headscript

This doesnt seem to work. I replaced the x, y,z with my coords.x, etc. But nothing spawns.

local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")

PED.CREATE_PED( 26,zombieSkinID,x, y, z,0,true,true)

 

look one down

i can't get createped to work at all

 

here is my whole script which works

local testmodule = {}testmodule.loaded = falsetestmodule.zombies = {}function testmodule.tick()	if(not testmodule.loaded) then 		local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")		local playerPed = PLAYER.PLAYER_PED_ID()		local player = PLAYER.GET_PLAYER_PED(playerPed)		local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		--local veh = VEHICLE.CREATE_VEHICLE(GAMEPLAY.GET_HASH_KEY("DINGHY"), playerPosition.x, playerPosition.y, playerPosition.z, -1, true,true);        local veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)		STREAMING.REQUEST_MODEL(zombieSkinID)		--ENTITY.SET_ENTITY_COORDS_NO_OFFSET(playerPed, 5303.311, -5189, 92.51867, false, false, true);		while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do				wait(50)		end		for i = 0 ,10,1 do			testmodule.zombies[i] = PED.CREATE_PED( 26,zombieSkinID,playerPosition.x, playerPosition.y, playerPosition.z,0,false,true)					end		STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(zombieSkinID)		testmodule.loaded = true	end    --print("Hello World! 2")	endreturn testmodule 

 

Anyone know how to use this function? I assume the arguments it takes have something to do with defining the diameter of the sphere or something?

 

VEHICLE::GET_RANDOM_VEHICLE_IN_SPHERE

Hash: 0x57216D03

Any GET_RANDOM_VEHICLE_IN_SPHERE(Any p0, Any p1, Any p2, Any p3,

Any p4, Any p5) // 0x57216D03

dunno sorry

Edited by headscript

Share this post


Link to post
Share on other sites
antd

 

 

 

 

 

 

Thanks for this tool, headscript.

 

Could you please explain briefly how to reload the lua files in-game?

main.lua

function init()	local module_folder = "scripts/"	package.path = module_folder .. "?.lua;" .. package.path	GRAPHICS.SET_DEBUG_LINES_AND_SPHERES_DRAWING_ACTIVE(1)endfunction tick()	--print("test")	if(get_key_pressed(115)) then		if (package.loaded.testmodule ~= nil) then			package.loaded.testmodule = nil		end	end		testmodule = require "testmodule"	testmodule.tick()	end

testmodule.lua

local testmodule = {}testmodule.loaded = falsefunction testmodule.tick()	if(not testmodule.loaded) then 		local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")		local playerPed = PLAYER.PLAYER_PED_ID()		local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do				--wait(5) wait function not yet implemented in released version		end		for i = 0 ,10,1 do						PED.CREATE_PED( 26,zombieSkinID,playerPosition.x, playerPosition.y, playerPosition.z,0,true,true)					end		STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(zombieSkinID)		testmodule.loaded = true	end    --print("Hello World! 2")	endreturn testmodule

when you press f4 testmodule.lua is getting reloaded

 

main.lua:

http://pastebin.com/tqN2hyUb

 

testmodule.lua:

http://pastebin.com/MGUJW0ev

 

It does not leave the 'loading story mode' screen. The lua console is displayed with 'loaded main.lua'.

 

I'm not sure what the problem is... If I disable lua.asi, it loads the game fine.

Oh, and NativeTrainer does not cause this issue.

Share this post


Link to post
Share on other sites
xsploit

 

 

 

 

 

 

 

Thanks for this tool, headscript.

 

Could you please explain briefly how to reload the lua files in-game?

main.lua

function init()	local module_folder = "scripts/"	package.path = module_folder .. "?.lua;" .. package.path	GRAPHICS.SET_DEBUG_LINES_AND_SPHERES_DRAWING_ACTIVE(1)endfunction tick()	--print("test")	if(get_key_pressed(115)) then		if (package.loaded.testmodule ~= nil) then			package.loaded.testmodule = nil		end	end		testmodule = require "testmodule"	testmodule.tick()	end

testmodule.lua

local testmodule = {}testmodule.loaded = falsefunction testmodule.tick()	if(not testmodule.loaded) then 		local zombieSkinID = GAMEPLAY.GET_HASH_KEY("u_m_y_zombie_01")		local playerPed = PLAYER.PLAYER_PED_ID()		local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do				--wait(5) wait function not yet implemented in released version		end		for i = 0 ,10,1 do						PED.CREATE_PED( 26,zombieSkinID,playerPosition.x, playerPosition.y, playerPosition.z,0,true,true)					end		STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(zombieSkinID)		testmodule.loaded = true	end    --print("Hello World! 2")	endreturn testmodule

when you press f4 testmodule.lua is getting reloaded

 

main.lua:

http://pastebin.com/tqN2hyUb

 

testmodule.lua:

http://pastebin.com/MGUJW0ev

 

It does not leave the 'loading story mode' screen. The lua console is displayed with 'loaded main.lua'.

 

I'm not sure what the problem is... If I disable lua.asi, it loads the game fine.

Oh, and NativeTrainer does not cause this issue.

 

Yeah same thing happened to me. Something isn't right createped should work.

Share this post


Link to post
Share on other sites
headscript

1. it doesnt check if game already loaded that u can see the player -> add a check then^^

2. get the new version and at the wait at while(not STREAMING.HAS_MODEL_LOADED(zombieSkinID)) do

else the thread lockups

Share this post


Link to post
Share on other sites
xsploit

I've just been sitting high as f*ck here trying to get sh*t to work. Just seen i have to update

Share this post


Link to post
Share on other sites
larperdoodle

Is it possible to add scripts without putting them in testmodule.lua yet?

 

(and without modifying main.lua)

Edited by larperdoodle

Share this post


Link to post
Share on other sites
headscript

Is it possible to add scripts without putting them in testmodule.lua yet?

 

(and without modifying main.lua)

why dont you just add more scripts and run the tick functions of the scripts from main.lua ?

and u can load in other luas other luas aswell

Share this post


Link to post
Share on other sites
larperdoodle

Key words there being "without modifying main.lua"

 

Players shouldn't have to know how to code to install a script. If any .lua file put in the scripts folder ran without modifying main, then we could start releasing our scripts.

 

I understand if this feature is just NYI, but it should be eventually

Edited by larperdoodle

Share this post


Link to post
Share on other sites
headscript

Key words there being "without modifying main.lua"

 

Players shouldn't have to know how to code to install a script. If any .lua file put in the scripts folder ran without modifying main, then we could start releasing our scripts.

then someone (or me maybe) should write it that it calls

all scripts in this folder

Share this post


Link to post
Share on other sites
burnsyboo

 

Key words there being "without modifying main.lua"

 

Players shouldn't have to know how to code to install a script. If any .lua file put in the scripts folder ran without modifying main, then we could start releasing our scripts.

then someone (or me maybe) should write it that it calls

all scripts in this folder

 

it would be nice if you could do that bro it would make it a lot more friendly

Share this post


Link to post
Share on other sites
headscript

 

 

Key words there being "without modifying main.lua"

 

Players shouldn't have to know how to code to install a script. If any .lua file put in the scripts folder ran without modifying main, then we could start releasing our scripts.

then someone (or me maybe) should write it that it calls

all scripts in this folder

 

it would be nice if you could do that bro it would make it a lot more friendly

 

alright doing it atm

edit: done

Edited by headscript

Share this post


Link to post
Share on other sites
burnsyboo

 

 

 

Key words there being "without modifying main.lua"

 

Players shouldn't have to know how to code to install a script. If any .lua file put in the scripts folder ran without modifying main, then we could start releasing our scripts.

then someone (or me maybe) should write it that it calls

all scripts in this folder

 

it would be nice if you could do that bro it would make it a lot more friendly

 

alright doing it atm

edit: done

 

Nice one mate this will surely help people a lot

Share this post


Link to post
Share on other sites
larperdoodle

Awesome, thanks!

You should consider posting it on www.gta5-mods.com as a tool

 

You should also make it more clear if scripts should go in the scripts folder or the addins subfolder. Or both?

By the looks of it though, custom scripts go in addins

Edited by larperdoodle

Share this post


Link to post
Share on other sites
headscript

Awesome, thanks!

You should consider posting it on www.gta5-mods.com as a tool

 

You should also make it more clear if scripts should go in the scripts folder or the addins subfolder. Or both?

By the looks of it though, custom scripts go in addins

custom scripts go in addins

thats right^^

but you can still overwrite everything if u want

Share this post


Link to post
Share on other sites
Aardvark2015

tick is only called every 50ms to not lower the game fps but i can try to set it to 0 which i havent tried but the native trainer uses

 

Maybe you could create a binding for the WAIT/scriptWait function in lua, and put the call main.lua tick. Then everyone can play with the sleep amount and see what works for them :)

 

Edit: Nevermind, you already did that!

Edited by Aardvark2015

Share this post


Link to post
Share on other sites
headscript

 

tick is only called every 50ms to not lower the game fps but i can try to set it to 0 which i havent tried but the native trainer uses

 

Maybe you could create a binding for the WAIT/scriptWait function in lua, and put the call main.lua tick. Then everyone can play with the sleep amount and see what works for them :)

 

Edit: Nevermind, you already did that!

 

yep^^

here a Bodyguard lua script

call it bodyguard.lua and put it in the scripts/addins folder

Numpad 5 to spawn Bodyguards

http://pastebin.com/B4ZzRDUc

Share this post


Link to post
Share on other sites
diamond-optic

I wanted to make use of "or" to make that neater, but i couldn't figure it out, so several "if"s it is

 

 

this works...

if (onHitPed < 1000) or (onVehHit < 1000) or (againstTraffic < 1000) then  PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)  PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)end

Share this post


Link to post
Share on other sites
noahvt

I'm trying to put a cruisecontrol script into the scripthook native trainer but I cannot find one value

 

So, the script goes as following:

 

VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, cruiseSpeed);

 

and it was converted already but I get the error "identifier "veh" is undefined" ​

so somewhere in the LUA.asi file it should say something like "veh = ?" or "? = veh" but since I cannot decompile the asi file can someone tell me how "veh" is defined?​

Share this post


Link to post
Share on other sites
Tusillody

 

I wanted to make use of "or" to make that neater, but i couldn't figure it out, so several "if"s it is

 

 

this works...

if (onHitPed < 1000) or (onVehHit < 1000) or (againstTraffic < 1000) then  PLAYER.SET_PLAYER_WANTED_LEVEL(player, 1, true)  PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(player, true)end

 

 

It does, thanks. Wasn't separating them with () when I tried :p

Share this post


Link to post
Share on other sites
larperdoodle

I'm trying to put a cruisecontrol script into the scripthook native trainer but I cannot find one value

 

So, the script goes as following:

 

VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, cruiseSpeed);

 

and it was converted already but I get the error "identifier "veh" is undefined" ​

so somewhere in the LUA.asi file it should say something like "veh = ?" or "? = veh" but since I cannot decompile the asi file can someone tell me how "veh" is defined?​

 

 

 

This is taken from my cruise control script, and was originally taken from the example script to add 4 stars to the player when they entered a vehicle.

 

local playerPed = PLAYER.PLAYER_PED_ID()local player = PLAYER.GET_PLAYER_PED(playerPed)local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)if(playerExists) thenif(PED.IS_PED_IN_ANY_VEHICLE(playerPed, false)) thenlocal veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)

Here is the full code for my cruise control script

http://hastebin.com/bijirefegu.lua

Edited by larperdoodle

Share this post


Link to post
Share on other sites
KingDong

Im trying to have 2 different binds but im doing something wrong and i dont know what it is

function tick()        local playerPed = PLAYER.PLAYER_PED_ID()	local player = PLAYER.GET_PLAYER_PED(playerPed)	local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)	if(playerExists) then		if(PED.IS_PED_IN_ANY_VEHICLE(playerPed, false)) then			local veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)			if(get_key_pressed(97)) then				VEHICLE.SET_VEHICLE_FORWARD_SPEED(veh,1200)				local testmodule = {} function tick()        local playerPed = PLAYER.PLAYER_PED_ID()        local player = PLAYER.GET_PLAYER_PED(playerPed)        local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)        if(PLAYER.IS_PLAYER_ONLINE() and playerExists) then                if(get_key_pressed(76)) then                        local playerPed = PLAYER.PLAYER_PED_ID();                        local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);                        local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);                        local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());                        PED.SET_PED_AS_GROUP_MEMBER(clone, group);                        AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(clone, 5000, 0);                        PED.SET_PED_KEEP_TASK(clone, true);                        WEAPON.GIVE_DELAYED_WEAPON_TO_PED(clone, GAMEPLAY.GET_HASH_KEY("weapon_pistol50"), 5, true);                        ENTITY.SET_ENTITY_INVINCIBLE(clone, false);                                       end                                                                                                                                                                                                  endend			end		end	endend 

Super speed works but the bodyguard one doesnt

in the bodyguard one do i change the coords to what i want? or is it supposed to spawn where i aim?

local clone = PED.CREATE_RANDOM_PED(coords.x, coords.y, coords.z);

 

Share this post


Link to post
Share on other sites
burnsyboo

Hello if its not too much to ask please could someone help me get started with lua scripting i am hoping to create several scripts for GTA V PC

 

An idea of a script i am going to try to create is

 

A script that turns water into a solid object that can be walked on

 

 

Please could someone help me with this as i have zero knowledge when it comes to lua scripting )-:

 

Thank you

Edited by burnsyboo

Share this post


Link to post
Share on other sites
r34ld34l

Hello if its not too much to ask please could someone help me get started with lua scripting i am hoping to create several scripts for GTA V PC

 

An idea of a script i am going to try to create is

 

A script that turns water into a solid object that can be walked on

 

 

Please could someone help me with this as i have zero knowledge when it comes to lua scripting )-:

 

Thank you

Don't think that is possible.

Share this post


Link to post
Share on other sites
wozzy

Thank you for this, it works great, ! I didn't realize at first that this had hot reload working, it makes things much easier. Having a debug console's also very useful

 

Now I just need to get a little more used to LUA

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.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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