Hi guys, I have this script that I use for cooking and I would like to implement a skill on it, however I don't have the knowledge to implement in the TFS neither on the client, so I would like some help to create this skill inside the script below. The skill would increase everytime you cook something. Each recipe would give a different amount of skill experience. To create some difficult recipes the player would need to have a certain amount of skill. Also I would like for the player to check his cooking skill somehow.
Lua:
local config = {
-- Configuracao da Janela Modal
mainTitleMsg = "Cooking System", -- TITUTLO DA JANELA QUE ABRE
mainMsg = "Welcome to the cooking system. Please choose a type of food to begin.", -- MENSAGEM DA JANELA
craftTitle = "Cooking System: ", -- Titulo da tela de craft apos o player selecionar a vocacao destinada dos items
craftMsg = "Here is a list of all items that can be cooked", -- Mensagem na tela de craft após escolhas do jogador de vocação
-- Fim da config Janela Modal
-- Notificacoes ao player
needItems = "You do not have all the required items to make ", -- Mensagem que aparece quando o player tenta craftar e nao tem todos os items
-- Configuracoes de Crafting
system = {
[1] = {vocation = "Salt", -- Isto e apenas uma categoria, nao influencia em nada
items = {
[1] = {item = "Fried Fish Fillet", -- item name (O NOME TEM QUE SER EXATO, SENAO NAO FUNCIONA!)
itemID = 7756, -- ID do item que sera feito, tem que ser compativel com o nome acima
reqItems = { -- items e quantidade dos items necessarios para craftar
[1] = {item = 5921, count = 1}, -- heaven blossom
[2] = {item = 27905, count = 2}, -- Small Fish
},
},
[2] = {item = "Consecrated Beef",
itemID = 7748,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[3] = {item = "Roasted Meat",
itemID = 7755,
reqItems = {
[1] = {item = 7754, count = 1}, -- Raw Meat
[2] = {item = 11245, count = 1}, -- bunch of ripe rice
},
},
[4] = {item = "Delicatessen Salad",
itemID = 7750,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[5] = {item = "Tropical Marinated Tiger",
itemID = 7764,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[6] = {item = "Stockfish",
itemID = 7757,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[7] = {item = "Salmon Fillet",
itemID = 7763,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[8] = {item = "Shark Steak",
itemID = 7771,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[9] = {item = "Fish With Troll",
itemID = 7858,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[10] = {item = "Grilled Common Fish Without Head",
itemID = 7856,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[11] = {item = "Grilled Common Fish With Head",
itemID = 7857,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[12] = {item = "Fish and Octopus",
itemID = 7777,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[13] = {item = "Uncommon Fish With Troll",
itemID = 7855,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[14] = {item = "Uncommon Fish Soup",
itemID = 7774,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[15] = {item = "Grilled Uncommon Fish Without Head",
itemID = 7776,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[16] = {item = "Grilled Uncommon Fish With Head",
itemID = 7854,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[17] = {item = "Uncommon Shark Steak",
itemID = 7775,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[18] = {item = "Uncommon Fish And Octopus",
itemID = 7772,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[19] = {item = "Uncommon Octopus in a Plate",
itemID = 7862,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[20] = {item = "Rare Fish With Troll",
itemID = 7770,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[21] = {item = "Common Fish Soup",
itemID = 7766,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[22] = {item = "Grilled Rare Fish Without Head",
itemID = 7768,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[23] = {item = "Grilled Rare Fish With Head",
itemID = 7769,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[24] = {item = "Rare Shark Steak",
itemID = 7767,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[25] = {item = "Rare Octopus in a Plate",
itemID = 7765,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[26] = {item = "Deepsea Fish With Troll",
itemID = 7747,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[27] = {item = "Deepsea Fish Soup",
itemID = 7861,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[28] = {item = "Grilled Deepsea Fish Without Head",
itemID = 7745,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[29] = {item = "Grilled Deepsea Fish With Head",
itemID = 7746,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[30] = {item = "Deepsea Shark Steak",
itemID = 7773,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[31] = {item = "Deepsea Fish And Octopus",
itemID = 7859,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
[32] = {item = "Deepsea Octopus in a Plate",
itemID = 7860,
reqItems = {
[1] = {item = 2671, count = 2}, -- ham
[2] = {item = 2684, count = 1}, -- carrot
[3] = {item = 2741, count = 2}, -- moon flower
},
},
},
},
[2] = {vocation = "Sweet",
items = {
[1] = {item = "Blueberry Cupcake",
itemID = 7744,
reqItems = {
[1] = {item = 8839, count = 1}, -- plum
[2] = {item = 2677, count = 5}, -- blueberries
[3] = {item = 5467, count = 2}, -- bunch of sugar cane
[4] = {item = 7245, count = 1}, -- piece of cactus
[5] = {item = 2796, count = 1}, -- green mushroom
},
},
[2] = {item = "Strawberry Cupcake",
itemID = 7758,
reqItems = {
[1] = {item = 2680, count = 1}, -- strawberry
[2] = {item = 8840, count = 1}, -- raspberry
[3] = {item = 5467, count = 2}, -- bunch of sugar cane
[4] = {item = 7245, count = 1}, -- piece of cactus
[5] = {item = 27924, count = 1}, -- Rare Red Mushroom
},
},
[3] = {item = "Lemon Cupcake",
itemID = 7752,
reqItems = {
[1] = {item = 8841, count = 1}, -- lemon
[2] = {item = 27918, count = 1}, -- Hot Mushroom
[3] = {item = 5467, count = 2}, -- bunch of sugar cane
[4] = {item = 7245, count = 1}, -- piece of cactus
[5] = {item = 2795, count = 1}, -- fire mushroom
[6] = {item = 27927, count = 1}, -- Strange Mushroom
},
},
[4] = {item = "Meringue Cake",
itemID = 7753,
reqItems = {
[1] = {item = 28014, count = 1}, -- Forbidden Fruit
[2] = {item = 27913, count = 1}, -- Venomous Mushroom
[3] = {item = 5467, count = 2}, -- bunch of sugar cane
[4] = {item = 7245, count = 1}, -- piece of cactus
},
},
},
},
},
}
local player = Player(cid)
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
player:sendMainCraftWindow(config)
return true
end