[Release] Simple Loadout Script

Simple Loadout Script

Simple Loadout Script is a easy to use and install loadout script made by ECLIP3S. All you have to do is install and type /loadout in game. Keep in mind this is my first release so please go easy on me.

Loadout:
Tear Gas
Combat Pistol
Carbine Rifle
Pump Shotgun
Stun Gun
Nightstick
Flashlight

Installation and Usage
Download the script here
Rename ‘loadouts-master’ to ‘loadouts’
Add the following line to your server.cfg:

start loadouts

Restart your server

After you restarted your server type /loadout in game and enjoy!

Changelog:

V1.1 Fixed chat message

Wrong section please put it in the #development:releases section,
Thanks :slight_smile:

He may not have the proper requirements…

Moved to Resource Development & Modding : Releases.

Thanks, yeah I can’t create a topic there.

All cool, are you able to put the file in the github and not only a .rar?

If you mean __resource.lua and client.lua and server.lua then done

Looks good, great job! Imma be using this!

Thanks! Hope you like it.

Oh I see what your talking about, I fixed it!

Thanks man, pretty simple and it must work pretty good

So, is it possible to only have this for a few jobs? Like mecano with the repair kit, ambulance with the med kit and the police with the gun and nightstick.

But only limited to these jobs?

Is it just for police officers?

here is shorter code if you want to optimise your script:

local policeloadout = {
	{"WEAPON_TEARGAS"},
	{"WEAPON_COMBATPISTOL"},
	{"WEAPON_STUNGUN"},
	{"WEAPON_PUMPSHOTGUN"},
	{"WEAPON_CARBINERIFLE"},
	{"WEAPON_NIGHTSTICK"},
	{"WEAPON_FLASHLIGHT"},
}
-----------------------------------------------------------------------------------
	for k,v in ipairs(policeloadout) do
        local weapon = table.unpack(v)
		print("Weapon given: "..weapon)
	    GiveWeaponToPed(playerPed, GetHashKey(weapon), 9999, true, true)
     	
	end
Client.lua

RegisterNetEvent(‘guns’)
AddEventHandler(‘guns’, function()
local player = GetPlayerPed(-1)
Citizen.CreateThread(function()
local rifle = GetHashKey(“WEAPON_CARBINERIFLE”)
local shotgun = GetHashKey(“WEAPON_PUMPSHOTGUN”)
local pistol = GetHashKey(“WEAPON_PISTOL”)
local taser = GetHashKey(“WEAPON_STUNGUN”)
local baton = GetHashKey(“WEAPON_NIGHTSTICK”)
local torch = GetHashKey(“WEAPON_FLASHLIGHT”)
GiveWeaponToPed(player, rifle, 1000, 0, 1)
GiveWeaponToPed(player, shotgun, 1000, 0, 1)
GiveWeaponToPed(player, pistol, 1000, 0, 1)
GiveWeaponToPed(player, taser, 1000, 0, 0)
GiveWeaponToPed(player, baton, 1000, 0, 0)
GiveWeaponToPed(player, torch, 1000, 0, 0)
end)
end)

Server.lua

AddEventHandler(‘chatMessage’, function(set, n, e)
local message = string.lower(e)
if message == “/onduty” then
CancelEvent()
TriggerClientEvent(‘guns’, set)
end
end)

This code does the same but allows for you to set attachments therefore better optimized.

Alright thanks!

Yes I will add it for others soon

That would have to be setup with something like ESX or vRP

Thanks!