ScriptsM Smash Bottle
A simple script for qbcore/esx to smash bottle and get weapon.
Installation
Install all resource dependencies.
- InteractSound (opens in a new tab)
- T-Notify (opens in a new tab)
- QBCore (opens in a new tab) or:
- ESX (opens in a new tab)
Download a release (opens in a new tab) or clone the source code.
git clone https://github.com/ScriptsM/ScriptsM-SmashBottle.git
Set up the InteractSound (opens in a new tab)
To get sounds working, you need to install bottle.ogg from zip archive following this guide:
- Add bottle.ogg from zip archive to InteractSound/client/html/sounds
- Open __resource.lua and modify following portion:
files({
'client/html/index.html',
-- Begin Sound Files Here...
-- client/html/sounds/ ... .ogg
...
})
- Now you are done with sounds
Config
There you can find an config of script
# Set the bottle item name to broke
Config.BottleItem = 'piswasser_bottle'
# Set the framework you are using(qb or esx)
Config.Framework = 'qb'
# Notification export to start persistant notify
Config.PersistNotify = function()
exports['t-notify']:Persist({
id = 'smashbottlehelp',
step = 'start',
options = {
style = 'message',
title = 'Bottle',
message = 'Smash Bottle: [E], Cancel: [X]',
sound = true
}
})
end
# Notification export to end peristant notify
Config.EndPersistNotify = function()
exports['t-notify']:Persist({
id = 'smashbottlehelp',
step = 'end'
})
end