This package is a correction of the SetPlayerWeapon() function, it’s allow you to add weapon to a player when he jump or run, simple.
-
Add the "Onset_Weapon_Patch" folder to your server packages
-
Edit your server_config.json and add "Onset_Weapon_Patch" in the packages section before the files who need it
"packages": [
"Onset_Weapon_Patch"
],
- On the files who needs to add weapons to player, initialize the Onset_Weapon_Pacth using this function
local Weapon = ImportPackage("Onset_Weapon_Patch")
After that you should be able to use the built-in functions
SetWeapon(player, weapon_model, ammo, equip, weapon_slot , bLoaded)
GetWeaponPlayer(player) -- return Player Weapon list infos
WeaponPlayer[player][slot].model = model
WeaponPlayer[player][slot].ammo = ammo
WeaponPlayer[player][slot].equip = equip
WeaponPlayer[player][slot].slot = slot
WeaponPlayer[player][slot].bLoaded = bLoaded
[ Simple command who randomly change the player weapon every 5 seconds ]
local Weapon = ImportPackage("Onset_Weapon_Patch") -- Import to your Server Script OnsetWeaponPatch
AddCommand("w", function(player)
CreateTimer(function()
Weapon.SetWeapon(player, math.random(2,21), 200, true, 1, true) -- Use this function to set player weapon
end, 5000)
end)
Join Origin Discord server now !
This project is licensed under the MIT License