23.3 C
New York
Wednesday, September 30, 2020

VR Ping Pong Pro PSVR PS4 PKG Download [ 4.13 GB ] + Update v1.02 + Latest Delta Patch| PS4 FW 6.72 Games Free...

VR Ping Pong Pro PSVR PS4 PKG Download + Update v1.02 + Latest Delta Patch| PS4 FW 6.72 Games Free Download VR Ping Pong...

Latest Posts

Serious Sam 4 Digital Deluxe Edition v1.02 Repack Download [ 25 GB ] + HotFix / Build 557352/5595962 + DLC + Bonus + Multiplayer...

Serious Sam 4 Digital Deluxe Edition v1.02 Repack Download + HotFix / Build 557352/5595962 + DLC + Bonus + Multiplayer | Fitgirl Repacks...

Forza Horizon 4 Ultimate Edition Repack Download [ 40 GB ] + Update v1.437.664.2 Complete All Cars Pack + DLC Unlocker

Download Forza Horizon 4 Ultimate Edition Fitgirl Repack Version and Forza Horizon 4 Ultimate Edition v1.383.263.2 Repack Download + Complete All Cars Pack...

Rebel Galaxy Outlaw Repack Download [ 7.5 GB ] | Steam Build 5581719 (v1.18b) – Chronos | Fitgirl Repacks

Rebel Galaxy Outlaw Repack Download | Steam Build 5581719 (v1.18b) - Chronos | Fitgirl Repacks and Based on Steam Build 5581719 (v1.18b) release:...

Mafia Definitive Edition Repack Download [ 35.63 GB ] [FULL UNLOCKED]

Mafia Definitive Edition Repack Download and Based on Mafia.Definitive.Edition-FULL.UNLOCKED.zip Game Description Mafia Definitive Edition Repack Download -  Part one of the Mafia crime saga...

How to make a C# Script Mod for Grand Theft Auto V ?

How to make a C# Script Mod for Grand Theft Auto V ?

This tutorial is using Grand Theft Auto V – Mod Creator

Before starting, please install the tool and ensure you have all of the files.

- Advertisement -

The first step is to name your mod, this is going to be the name of your Class, and Namespace (for more information on classes & namespaces.

Replace the following with your mod name:

namespace ModName
- Advertisement -

Next, replace these:

        string ModName = "MOD NAME";
        string Developer = "YOUR NAME";
        string Version = "1.0";

In most cases, you will not need to change the Version, but feel free to do whatever you want.

We will be making a simple bodyguard script.

To start, lets insert a key press.
We will use the KeyDown tool.
Navigate to Insert –> KeyDown

Ensure that your cursor is inside of the “onKeyDown” method

Type your desired key and press “KeyDown”. This will insert a new if statement (For information on if statements, )

Now lets create your bodyguard inside of the GTA V game world.
To do this you will need to write some code yourself.
Before we continue, we need to have our player and playerPed variables. (For information on variables,)
To do this, you can use the Player tools.
Navigate to Insert –> Player –> player Variable
You also need the playerPed variable
Navigate to Insert –> Player –> playerPed Variable

 

Your code should now look something like this

 

Now, lets spawn the bodyguard.
You will be using the World.CreatePed() method. (For information on methods/functions, )
Insert the following code to your script:

Ped bodyguard = World.CreatePed(new Model(PedHash.Armoured02SMM), playerPed.Position);

We have now created the bodyguard at the players position and can mess with him using his variable bodyguard.
PedHash.Armoured02SMM is the bodyguard’s model hash, you can change this if you’d like.

Next step is to give him weapons, we will just give him a Pistol for now.
Insert the following code:

bodyguard.Weapons.Give(WeaponHash.Pistol, 9999, true, true);

This code gives the bodyguard a pistol with 9999 ammo. You can add more weapons if you would like, just copy and change the WeaponHash.

Now we need to give the bodyguard some armor.
You can use the Ped.Armor variable.

bodyguard.Armor = 100; // Armor ranges from 1-100

We’re almost done, we need to add the bodyguard to the players group so he protects the player.
We are using a native from the NativeDB here, using the GTA.Native.Function.Call() method

PedGroup playerGroup = playerPed.CurrentPedGroup; // gets the players current group
Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, bodyguard, playerGroup); // puts the bodyguard into the players group

You are gonna need to set the combat ability as well.

Function.Call(Hash.SET_PED_COMBAT_ABILITY, bodyguard, 100); // 100 = attack

The final step here is optional, but we are going to notify the player when a bodyguard is spawned.
We can use the tool Notify for this.
Navigate to Insert –> UI –> Notify

 

Feel free to change “Bodyguard spawned!” to whatever you like.

You’re done, to check, make sure your code looks similar to this:

 

ALL THAT IS LEFT NOW IS TO SAVE YOUR FILE AND RUN THE GAME!

Press File –> Save As… and navigate to your Grand Theft Auto V folder,
we need to put this file in the scripts folder, if you do not have this folder, create it.

LETS RUN THE GAME AND TEST THE SCRIPT.

Finally You Understand How to make a C# Script Mod for Grand Theft Auto V .

You May Also like

GTA V IRONMAN V2.0 MOD [ 8 MB ]

****

Latest Posts

Serious Sam 4 Digital Deluxe Edition v1.02 Repack Download [ 25 GB ] + HotFix / Build 557352/5595962 + DLC + Bonus + Multiplayer...

Serious Sam 4 Digital Deluxe Edition v1.02 Repack Download + HotFix / Build 557352/5595962 + DLC + Bonus + Multiplayer | Fitgirl Repacks...

Forza Horizon 4 Ultimate Edition Repack Download [ 40 GB ] + Update v1.437.664.2 Complete All Cars Pack + DLC Unlocker

Download Forza Horizon 4 Ultimate Edition Fitgirl Repack Version and Forza Horizon 4 Ultimate Edition v1.383.263.2 Repack Download + Complete All Cars Pack...

Rebel Galaxy Outlaw Repack Download [ 7.5 GB ] | Steam Build 5581719 (v1.18b) – Chronos | Fitgirl Repacks

Rebel Galaxy Outlaw Repack Download | Steam Build 5581719 (v1.18b) - Chronos | Fitgirl Repacks and Based on Steam Build 5581719 (v1.18b) release:...

Mafia Definitive Edition Repack Download [ 35.63 GB ] [FULL UNLOCKED]

Mafia Definitive Edition Repack Download and Based on Mafia.Definitive.Edition-FULL.UNLOCKED.zip Game Description Mafia Definitive Edition Repack Download -  Part one of the Mafia crime saga...

Don't Miss

Zoids Assault XBOX360 ISO Download [7.30GB] [Region Free] | XBOX 360 ISO Games Highly Compressed

Zoids Assault XBOX360 ISO Download | XBOX 360 ISO Games Highly Compressed and Zoids Assault XBOX360 ISO Release Info Zoids Assault XBOX360 ISO Download-...

Minecraft Dungeons v1.3.2.0.4307136-0xdeadc0de Repack Download [ 968 MB ] + 2 DLCs + Multiplayer | Fitgirl Repacks

Minecraft Dungeons v1.3.2.0.4307136-0xdeadc0de Repack Download + 2 DLCs + Multiplayer | Fitgirl Repacks and Based on MD Launcher Edition v1.4.3.0_4640940: 3.8 GB, thanks...

Hotshot Racing Repack Download [ 1.3 GB ] Build 5412478-CHRONOS | Fitgirl Repacks

Hotshot Racing Repack Download Build 5412478-CHRONOS | Fitgirl Repacks and Based on Steam Build 5412478: 3.9 GB, thanks to chronos! chronos! Game Description Hotshot Racing Repack...

Tour de France 2020 v1.35.0.0 Repack Download [ 15.1 GB ] Build 5436642-CHRONOS | Fitgirl Repacks

Tour de France 2020 v1.35.0.0 Repack Download Build 5436642-CHRONOS | Fitgirl Repacks and Based on Steam release Build 5436642 (v1.35.0.0): 24.6 GB, thanks...

Disgaea 4 Complete+ Repack Download [ 1.9 GB ] Build 5445189-CHRONOS | Fitgirl Repacks

Disgaea 4 Complete + Repack Download Build 5445189-CHRONOS | Fitgirl Repacks and Based on Steam release Build 5445189: 6.3 GB, thanks to chronos! Game...