okay so in server.lua file i have registered the server event in the pic. the code above mine is what the developer used to add rocks to your inventory when you mine a rock. i want to implement a seperate pool with a percent chance to hit and get something else with the rocks. here is the code i implemented to try to accomplish this as well as the code the creator used to add rocks to the inventory. i get this error in the server console shown in the second photo. it says there is an unexpected symbol near my closing parenthese. so it just doesnt load server.lua at all and breaks the whole script. any help is greatly appreciated.
for those who do not wish to open the links for the images. here is the code that jimathy used to add rocks to inventory
RegisterServerEvent('jim-mining:MineReward', function()
local Player = QBCore.Functions.GetPlayer(source)
local randomChance = math.random(1, 3)
Player.Functions.AddItem('stone', randomChance, false, {["quality"] = nil})
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items["stone"], "add", randomChance)
end)
here is the code i tried to implement to add the special pool(item is a placeholder)
RegisterServerEvent('jim-mining:Specialloot', function()
local Player = QBCore.Functions.GetPlayer(source)
if(math.random(1, 100) < 99)
then
player.functions.additem('lockpick', 1, false, {["quality"] = nil})
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items["lockpick"], "add", randomChance)
end)
and the server console output this error.
Error parsing script @jim-mining/server.lua in resource jim-mining: @jim-mining/server.lua:37: unexpected symbol near ')'