Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Origin-OnSet/Onset_Weapon_Patch
A synchronized version of the original SetPlayerWeapon function for Onset
https://github.com/Origin-OnSet/Onset_Weapon_Patch
Last synced: 3 months ago
JSON representation
A synchronized version of the original SetPlayerWeapon function for Onset
- Host: GitHub
- URL: https://github.com/Origin-OnSet/Onset_Weapon_Patch
- Owner: Origin-OnSet
- License: mit
- Created: 2020-05-22T17:37:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-06T14:16:23.000Z (over 4 years ago)
- Last Synced: 2024-06-20T18:33:38.374Z (5 months ago)
- Language: Lua
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-onset - Weapon Patch - Fix of SetPlayerWeapon() function, allows you to add a weapon to a player when he jumps or runs. (Packages and Plugins / Other packages)
README
# 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
```json
"packages": [
"Onset_Weapon_Patch"
],
```
- On the files who needs to add weapons to player, initialize the Onset_Weapon_Pacth using this function
```lua
local Weapon = ImportPackage("Onset_Weapon_Patch")
```
After that you should be able to use the built-in functions## Function
```lua
SetWeapon(player, weapon_model, ammo, equip, weapon_slot , bLoaded)
GetWeaponPlayer(player) -- return Player Weapon list infos
```## GetWeaponPlayer(player) Array List
```lua
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 ]
```lua
local Weapon = ImportPackage("Onset_Weapon_Patch") -- Import to your Server Script OnsetWeaponPatchAddCommand("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](https://discord.gg/MDEwtKr) server now !## License
This project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) License