exanime
I´m learning Lua
Hello, I have come to ask for help, I want the same item that I get from a quest, have different actionid, some help?
It will be an item with different actionid, being the Legendary item with less possibility of being given to the player, also that the description be added
I have this script
TFS 1.3
I still do not handle the metatables very well, any explanation ?
It will be an item with different actionid, being the Legendary item with less possibility of being given to the player, also that the description be added
I have this script
TFS 1.3
I still do not handle the metatables very well, any explanation ?
Code:
local ids = {
{thing = "Normal", chance = 85, itemID = 2475, actionID = 45113}, --85%
{thing = "Bound", chance = 13, itemID = 2475, actionID = 45114}, --13%
{thing = "Legendary", chance = 2, itemID = 2475, actionID = 45115} --2%
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local chance = math.random(1, 100)
if chance < ids.chance then
local Legs = player:additem(ids[chance].itemID,1,true, CONST_SLOT_WHEREEVER)
item:setActionId(Legs, ids[chance].actionID)
item:setAttribute(Legs, "description", ids[chance].thing)
player:sendTextMessage(TALKTYPE_ORANGE_1, "Random Legs Acquired!")
end
return true
end