feat: Configurable consumption of raid item #128
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR allows server owners and developers to either utilize the script's item removal system when executing a raid.
Details
In the config, I have provided a new config value that will allow server owners and developers to configure whether or not they prefer to consume the raid item upon use. I have left it disabled by default to prevent frustration from individuals that like to skim through configs or drag and drop without even looking at it.
UI Changes / Functionality
The
shared/config.lua
file has been adjusted to include a new field ConsumeRaidItem that determines whether or notserver/sv_property.lua
will fully consume the item upon use. There is also a small tip that will let server owners and developers know that it's encouraged to use ox_inventory's supported consumption feature because it will make the item have durability instead.Testing Steps
Perform a raid on a property.
If you have Config.ConsumeRaidItem's value as
true
, it should consume the raid item that's been set as Config.RaidItem's value.If you have Config.ConsumeRaidItem's value as
false
, the code will not automatically remove the raid item that's been set as Config.RaidItem's value.