Hey, I’m looking for a loadout script that equips just the weapons (and flashlight attachments, if possible) to the player. I know there are a few scripts out there, but they either change your ped model (or only work for a specific ped) and they use essentialmode, which I don’t use on our server.
We were hoping it would work something like this:
a user would do /loadout cop and they would receive a combat pistol, pump shotgun and carbine rifle all with flashlights, baton, stun gun, fire extinguisher, flares and a flashlight. Similar to AlfredoHelper that was released awhile back. That would be fantastic.
AddEventHandler('chatMessage', function(s, n, m)
local message = string.lower(m)
if message == "/guns" then
CancelEvent()
--------------
TriggerClientEvent('guns', s)
end
end)
Client:
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)
As for the attachments, never tried to do it, but this is a starting point I guess.