Skip to content

A synchronized version of the original SetPlayerWeapon function for Onset

License

Notifications You must be signed in to change notification settings

Origin-OnSet/Onset_Weapon_Patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onset_Weapon_Patch

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.

How to install

  • 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

Function

SetWeapon(player, weapon_model, ammo, equip, weapon_slot , bLoaded)
GetWeaponPlayer(player) -- return Player Weapon list infos 

GetWeaponPlayer(player) Array List

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

Exemple

[ 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)

Discord

Join Origin Discord server now !

License

This project is licensed under the MIT License

About

A synchronized version of the original SetPlayerWeapon function for Onset

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages