Closed GitMocha closed 1 year ago
After removing 'item.info.health' and just giving it a random number to give it processes.
RegisterNetEvent('ps-weedplanting:server:ProcessBranch', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
local item = Player.Functions.GetItemByName(Shared.BranchItem)
if item then
if Player.Functions.RemoveItem(Shared.BranchItem, 1, item.slot) then
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[Shared.BranchItem], 'remove', 1)
Player.Functions.AddItem(Shared.WeedItem, 2, false)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[Shared.WeedItem], 'add', 2)
end
end
end)
Send a PR for this, thanks
Sure thing
Installed this script, added sql, allows you to plant, maintain and harvest. When u try to "ProcessBranch" it does the animation but doesn't do anything else. No errors thrown in console/f8.
I'm gonna go on a limb and assume it's this part 'item.info.health'. I don't see where it's grabbing info.health anywhere. Maybe blind but i don't think there is. This is the only thing i see that could cause this.