Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Forum Support

    3. Suggestions

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


headscript
 Share

Recommended Posts

Great work man!

I just got into the modding scene (though I have python and java knowledge ) so this is a really nifty start for me.

Link to comment
Share on other sites

Great plugin! Larperdoodle actually stayed up all night writing his own mods, and I'm doing the same now, so thanks for making it so accessible! One thing I would like to request, however: would you be willing to change the default reload key to something like F7? F4 is Native Trainer, and it's getting a tad annoying to reset my mods when trying to spawn in vehicles, and I feel like others might eventually voice the same complaint.

 

Archibaldy

Link to comment
Share on other sites

diamond-optic

would you be willing to change the default reload key to something like F7? F4 is Native Trainer, and it's getting a tad annoying to reset my mods when trying to spawn in vehicles, and I feel like others might eventually voicethe same complaint.

 

 

 

i believe you can just change the main.lua

function tick()    --print("test")    if(get_key_pressed(115)) then        loadLibs()        loadAddIns()    end        for index, mod in pairs(addIns) do        if (mod.tick ~= nil) then                mod.tick()        end    end    end

change get_key_pressed(115) to get_key_pressed(118) for F7

Edited by diamond-optic
Link to comment
Share on other sites

I'm sorry but ah, where can i find the GTA V script commands ?

 

I would like to create an LUA script for GTA V that makes the car heavy =/

 

I remember there was one code for GTA SA that makes the car heavy but I don't remember which code was so...

 

Can you help me =?

 

Edit: I've managed to open the script for GTA SA, it was like this make_car and very_heavy 1

 

There are something like that ?

Edited by Player360
Link to comment
Share on other sites

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

Link to comment
Share on other sites

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

 

local playerPed = PLAYER.PLAYER_PED_ID()local veh = VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);	local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);local model = GAMEPLAY.GET_HASH_KEY("COACH");
if(get_key_pressed(119)) then  if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_A_VEHICLE(model)) then	STREAMING.REQUEST_MODEL(model);		while STREAMING.HAS_MODEL_LOADED(model) do				VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);				VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh);				print("Spawned!")				ENTITY.SET_ENTITY_HEADING(veh, ENTITY.GET_ENTITY_HEADING(playerPed));				STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model);				ENTITY.SET_VEHICLE_AS_NO_LONGER_NEEDED(veh);				end			end		end

I've been trying for a while and this is the closest I got the first click of F8 Spawns a crap load and lags then the second click of F8 crashes your game. I know its probably something easy to fix but any help would be appreciated.

Edited by Fatiz
Link to comment
Share on other sites

 

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

 

local playerPed = PLAYER.PLAYER_PED_ID()local veh = VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);	local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);local model = GAMEPLAY.GET_HASH_KEY("COACH");
if(get_key_pressed(119)) then  if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_A_VEHICLE(model)) then	STREAMING.REQUEST_MODEL(model);		while STREAMING.HAS_MODEL_LOADED(model) do				VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);				VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh);				print("Spawned!")				ENTITY.SET_ENTITY_HEADING(veh, ENTITY.GET_ENTITY_HEADING(playerPed));				STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model);				ENTITY.SET_VEHICLE_AS_NO_LONGER_NEEDED(veh);				end			end		end

I've been trying for a while and this is the closest I got the first click of F8 Spawns a crap load and lags then the second click of F8 crashes your game. I know probably something easy to fix but any help would be appreciated.

 

 

That's why I'm not risking using a loop. I'm trying to do it without one

 

..I mixed your script and mine together, and I did manage to do it without a loop, but then 6 busses dropped on me, lol

 

I got it! It's because of the .tick, but we can't just remove it

Edited by Reck1501
Link to comment
Share on other sites

Is there a chance you could change the way tick, init and unload are called in main.lua?

It's a very simple change and wont break older code.


From this:

for index, mod in pairs(addIns) do	if (mod.tick ~= nil) then		mod.tick()	endend

To this:

for index, mod in pairs(addIns) do	if (mod.tick ~= nil) then		mod:tick()	endend

We would be able to use "self" inside the modules functions.

Example:

function MODULE:init()	self.GUI = Libs["GUI"];	self.canClick = true;endInstead of..function MODULE:init()	MODULE.GUI = Libs["GUI"];	MODULE.canClick = true;end
Edited by DakotaCSS
Link to comment
Share on other sites

 

 

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

 

local playerPed = PLAYER.PLAYER_PED_ID()local veh = VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);	local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);local model = GAMEPLAY.GET_HASH_KEY("COACH");
if(get_key_pressed(119)) then  if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_A_VEHICLE(model)) then	STREAMING.REQUEST_MODEL(model);		while STREAMING.HAS_MODEL_LOADED(model) do				VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);				VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh);				print("Spawned!")				ENTITY.SET_ENTITY_HEADING(veh, ENTITY.GET_ENTITY_HEADING(playerPed));				STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model);				ENTITY.SET_VEHICLE_AS_NO_LONGER_NEEDED(veh);				end			end		end

I've been trying for a while and this is the closest I got the first click of F8 Spawns a crap load and lags then the second click of F8 crashes your game. I know probably something easy to fix but any help would be appreciated.

 

 

That's why I'm not risking using a loop. I'm trying to do it without one

 

..I mixed your script and mine together, and I did manage to do it without a loop, but then 6 busses dropped on me, lol

 

I got it! It's because of the .tick, but we can't just remove it

 

Mind posting the the script that you made without the loop

Link to comment
Share on other sites

Mind posting the the script that you made without the loop

local vehicle = {}function vehicle.tick()	if(get_key_pressed(96)) then		local carID = GAMEPLAY.GET_HASH_KEY("COACH")		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		local veh = VEHICLE.CREATE_VEHICLE(carID, playerPosition.x, playerPosition.y, playerPosition.z, 0.0, true, true)		VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh)			endendreturn vehicle

If you tap 0 on your numpad quickly, it will only spawn one bus.

 

I seem to have broken the code somehow.. It won't work for me anymore

Edited by Reck1501
Link to comment
Share on other sites

 

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

 

local playerPed = PLAYER.PLAYER_PED_ID()local veh = VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);	local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);local model = GAMEPLAY.GET_HASH_KEY("COACH");
if(get_key_pressed(119)) then  if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_A_VEHICLE(model)) then	STREAMING.REQUEST_MODEL(model);		while STREAMING.HAS_MODEL_LOADED(model) do				VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);				VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh);				print("Spawned!")				ENTITY.SET_ENTITY_HEADING(veh, ENTITY.GET_ENTITY_HEADING(playerPed));				STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model);				ENTITY.SET_VEHICLE_AS_NO_LONGER_NEEDED(veh);				end			end		end

I've been trying for a while and this is the closest I got the first click of F8 Spawns a crap load and lags then the second click of F8 crashes your game. I know its probably something easy to fix but any help would be appreciated.

 

Here ya go!

local Bringittome = {}function Bringittome.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(118)) then			local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);			local CARskinID = GAMEPLAY.GET_HASH_KEY("COQUETTE")			STREAMING.REQUEST_MODEL(CARskinID)			local car = VEHICLE.CREATE_VEHICLE(CARskinID, coords.x, coords.y, coords.z, 0, true, true) 			end																									endendreturn Bringittome
Link to comment
Share on other sites

 

 

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

 

local playerPed = PLAYER.PLAYER_PED_ID()local veh = VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);	local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);local model = GAMEPLAY.GET_HASH_KEY("COACH");
if(get_key_pressed(119)) then  if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_A_VEHICLE(model)) then	STREAMING.REQUEST_MODEL(model);		while STREAMING.HAS_MODEL_LOADED(model) do				VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);				VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh);				print("Spawned!")				ENTITY.SET_ENTITY_HEADING(veh, ENTITY.GET_ENTITY_HEADING(playerPed));				STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model);				ENTITY.SET_VEHICLE_AS_NO_LONGER_NEEDED(veh);				end			end		end

I've been trying for a while and this is the closest I got the first click of F8 Spawns a crap load and lags then the second click of F8 crashes your game. I know its probably something easy to fix but any help would be appreciated.

 

Here ya go!

local Bringittome = {}function Bringittome.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(118)) then			local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);			local CARskinID = GAMEPLAY.GET_HASH_KEY("COQUETTE")			STREAMING.REQUEST_MODEL(CARskinID)			local car = VEHICLE.CREATE_VEHICLE(CARskinID, coords.x, coords.y, coords.z, 0, true, true) 			end																									endendreturn Bringittome

 

It still spams the cars unless you tap the button extremely quick :p

Link to comment
Share on other sites

 

 

 

local vehicle = {}function vehicle.tick()	if(get_key_pressed(107)) then		local playerPed = PLAYER.PLAYER_PED_ID()		local playerPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)		VEHICLE.CREATE_VEHICLE(0xB779A091, playerPosition.x, playerPosition.y, playerPosition.z, 1, false, true)	endendreturn vehicle

Any idea why this isn't working? I'm trying to make it spawn an adder, but nothing happends when I execute it, and no errors in the console

 

local playerPed = PLAYER.PLAYER_PED_ID()local veh = VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);	local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);local model = GAMEPLAY.GET_HASH_KEY("COACH");
if(get_key_pressed(119)) then  if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_A_VEHICLE(model)) then	STREAMING.REQUEST_MODEL(model);		while STREAMING.HAS_MODEL_LOADED(model) do				VEHICLE.CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, false, true);				VEHICLE.SET_VEHICLE_ON_GROUND_PROPERLY(veh);				print("Spawned!")				ENTITY.SET_ENTITY_HEADING(veh, ENTITY.GET_ENTITY_HEADING(playerPed));				STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model);				ENTITY.SET_VEHICLE_AS_NO_LONGER_NEEDED(veh);				end			end		end

I've been trying for a while and this is the closest I got the first click of F8 Spawns a crap load and lags then the second click of F8 crashes your game. I know its probably something easy to fix but any help would be appreciated.

 

Here ya go!

local Bringittome = {}function Bringittome.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(118)) then			local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);			local CARskinID = GAMEPLAY.GET_HASH_KEY("COQUETTE")			STREAMING.REQUEST_MODEL(CARskinID)			local car = VEHICLE.CREATE_VEHICLE(CARskinID, coords.x, coords.y, coords.z, 0, true, true) 			end																									endendreturn Bringittome

 

It still spams the cars unless you tap the button extremely quick :p

 

Just add a delay(200) to the beginning.

Link to comment
Share on other sites

Has anyone figured out GET_CLOSEST_VEHICLE? Doesn't seem to work reliably for me, and only seems to detect empty ones.

Link to comment
Share on other sites

ASI: Loading "Z:\Steam\steamapps\common\Grand Theft Auto V\LUA.asi"

"LUA.asi" failed to load


Anyone else have this problem?

Link to comment
Share on other sites

I keep getting this error randomly, it seems to only happen when I try to add custom files

 

"tick: scripts/main.lua:285: attempt to index local 'mod' (a boolean value)"

 

The only way i found to fix it was re-installing the plugin, anyone know a fix?

Edited by 47goon
Link to comment
Share on other sites

if(get_key_pressed(118)) then			local CarSkinID = GAMEPLAY.GET_HASH_KEY("TURISMOR")			local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0)			STREAMING.REQUEST_MODEL(CarSkinID)			local veh = VEHICLE.GET_CLOSEST_VEHICLE(coords.x, coords.y, coords.z, 1000, CarSkinID, 0)			print(veh)			end

Can anyone shed some light on why this might not be working? Even if I stand beside a TurismoR veh returns 0.

Link to comment
Share on other sites

Aardvark2015
local veh = VEHICLE.GET_CLOSEST_VEHICLE(coords.x, coords.y, coords.z, 1000, CarSkinID, 0)

Can anyone shed some light on why this might not be working? Even if I stand beside a TurismoR veh returns 0.

 

 

IIRC I read here that the last argument is a bitflag which probably controls what kinds of vehicles are found.

You could try passing -1, which should have all bits set and maybe find everything...

 

Some values I see in decompiled scripts are: 0, 4, 6, (64 | 65536 | 2048 | 1 | 2 | 4 | 32 | 16 | 8)

Which bit does what is anyone's guess.

Link to comment
Share on other sites

 

local veh = VEHICLE.GET_CLOSEST_VEHICLE(coords.x, coords.y, coords.z, 1000, CarSkinID, 0)

Can anyone shed some light on why this might not be working? Even if I stand beside a TurismoR veh returns 0.

 

 

IIRC I read here that the last argument is a bitflag which probably controls what kinds of vehicles are found.

You could try passing -1, which should have all bits set and maybe find everything...

 

Some values I see in decompiled scripts are: 0, 4, 6, (64 | 65536 | 2048 | 1 | 2 | 4 | 32 | 16 | 8)

Which bit does what is anyone's guess.

 

Yeah I tried with all those & got no results whatsoever. I did copy another script and change it to local veh = VEHICLE.GET_CLOSEST_VEHICLE(coords.x, coords.y, coords.z, 1000, 0, 64) and it seem to be getting values. It changed only when I got close to empty cars, and would not change if I moved away from an empty one towards a car with a PED in it until I kicked them out and got back out. Changing the bit on the end didn't seem to change much except it broke when I set it to -1. It also doesnt seem to detect player owned cars, as I was just testing this in a private server with my TurismoR.

Edited by Swarm96
Link to comment
Share on other sites

Gonna try to fiddle around and learn some lua now because of this. Any favorite editors? Notepad++ or??

 

Thanks for any tips.

Link to comment
Share on other sites

When I start the game with this I get immediate wanted level of 4.

 

Loaded main.luaIncrease Wanted to 4
Increase Wanted to 4
Increase Wanted to 4
(lots more of these)

 

Any ideas?

 

Oops. Didn't have the main.lua file in there. Might help.

Edited by bugbutts
Link to comment
Share on other sites

Gonna try to fiddle around and learn some lua now because of this. Any favorite editors? Notepad++ or??

 

Thanks for any tips.

Notepad++ and SublimeText are very good ones, you don't need more. Both support plugins and autocompletion.

Link to comment
Share on other sites

Can anyone help me with why this isn't working?

local water = {}function water.unload()endfunction water.init()endfunction water.tick()	if(get_key_pressed(96)) then		MODIFY_WATER(0,0,0,0)	endendreturn water

I get this error: 335f235579.png

Link to comment
Share on other sites

Aardvark2015

I get this error: 335f235579.png

 

The functions here are in the same "namespace" as in natives.h, so:

WATER.MODIFY_WATER(0,0,0,0)
Link to comment
Share on other sites

 

I get this error: 335f235579.png

 

The functions here are in the same "namespace" as in natives.h, so:

WATER.MODIFY_WATER(0,0,0,0)

Thanks, now I don't get the error. But it doesn't seem to do anything? No matter I set the values to, the water just stays the same.

Am I missing something about how I would edit this?

Edited by Snuki
Link to comment
Share on other sites

The script doesn't work for me for some reason, it says that it failed to run in the log. I had the same issue with the vehicle controller script but that was solved somehow.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 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.