Closed Gentil-Boo closed 3 years ago
I knwon there is an example fo what to do, but I don't understand what file I have to edit.
and when I use
giveitem 1 bread 1
In the server console I got errors
`SCRIPT ERROR: @redemrp_inventory/server/sv_main.lua:397: attempt to index a nil value (local 'user')
ref (@redemrp_inventory/server/sv_main.lua:397) handler (@redem_roleplay/server/sv_main.lua:78) ref (@redemrp_inventory/server/sv_main.lua:396)`
You have to use it like this /giveitem bread 1 . Make sure you are an admin or superadmin. The item is given to yourself not to the selected id.
Unfortunately it does not work either
Unfortunately it does not work either
Do you have the item registered on your inventory config.lua?
after another test, it's working for the bread with your command /giveitem bread 1
in the game console.
but if I tried /giveitem WEAPON_MELEE_LANTERN_ELECTRIC 1
nothing happen
Awesome!
Make sure you have it registered like this in your inventory and try using /giveitem WEAPON_MELEE_LANTERN_ELECTRIC 100
["WEAPON_MELEE_LANTERN_ELECTRIC"] =
{
label = "Electric Lamp",
description = "A source of light, fire & fun",
weight = 0.5,
canBeDropped = true,
requireLvl = 0,
weaponHash = GetHashKey("weapon_melee_davy_lantern"),
imgsrc = "items/weapon_melee_electric_lantern.png",
type = "item_weapon",
},
Its' working. thx you
One last question. How to eat the bread in my inventory? When I drag and drop the bread on use windows, nothing happen
Its' working. thx you
One last question. How to eat the bread in my inventory? When I drag and drop the bread on use windows, nothing happen
No problem! If you want to eat the bread, first of all you have to set the variable (on the bread item) canBeUsed = true
inside the inventory config.lua. After that you have to register as usable item and add the logic to increase your food. You can check the script redemrp_status
if you want to know more about usable consumables.
Good. Now I can eat bread and drink water. there is this code into my config.lua for the crafting
Config.Crafting = {
["bread"] = {
items = { "empty","empty","empty", "wheat","wheat","wheat", "empty","empty","empty" }, requireJob = "empty", type = "cooking", amount = 1,
},
}
But, how to craft in the game, I did not find out. I need to use the 6 squares in inventory, but how ?
As you can see there, type = "cooking"
that means you require a cooking type crafting table to do that. In order to create crafting tables, check the redemrp_inventory README, there are also some examples in RedEM discord support chats aswell. I think if you put "empty" instead of "cooking" there, you will be able to craft right on the spot.
Try adding that into the server side of any script, make sure you add this on top of it aswell:
data = {}
TriggerEvent("redemrp_inventory:getData",function(call)
data = call
end)
I knwon there is an example fo what to do, but I don't understand what file I have to edit.
and when I use
giveitem 1 bread 1
In the server console I got errors
`SCRIPT ERROR: @redemrp_inventory/server/sv_main.lua:397: attempt to index a nil value (local 'user')