RazorBlade
Retired Snek
yeah, just remove that line. Not sure why that's even in there, that's not supposed to be part of my system xD I'll remove it
yeah, just remove that line. Not sure why that's even in there, that's not supposed to be part of my system xD I'll remove it
nil
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLookInTrade
data/events/scripts/player.lua:112: attempt to index global 'thing' (a nil value)
stack traceback:
[C]: in function '__index'
data/events/scripts/player.lua:112: in function <data/events/scripts/player.lua:108>
112 if thing:getId() == 2006 then
113 local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}
local description = "You see " .. item:getDescription(distance)
local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
if item:getId() == 2006 then
local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}
if isInArray(fluidType, item:getFluidType()) then
local effects = item:getEffects(item)
if effects[6] == 1 then
description = "You see a " .. apotency[tonumber(effects[4])].prefix .. " " .. effects[5] .. ".\n" .. item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
elseif effects[6] == 2 then
description = "You see a " .. effects[5] .. ".\n" .. item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
end
end
end
for i = 1, #aingredients do
if item:getId() == aingredients[i].id then
description = "You see " .. item:getDescription(distance) .. "\nEffects:\n1: "
if self:getStorageValue(aingredients[i].storages[1]) == 1 then
description = description .. aeffects[aingredients[i].effects[1]].fullname
else
description = description .. "Unknown"
end
description = description .. "\n2: "
if self:getStorageValue(aingredients[i].storages[2]) == 1 then
description = description .. aeffects[aingredients[i].effects[2]].fullname
else
description = description .. "Unknown"
end
end
end
self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. description)
post your events/scripts/player.luahow do i fix the duplacate description on look?
function Player:onLook(thing, position, distance)
local description = 'You see '
local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
if thing:getId() == 2006 then
local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}
if isInArray(fluidType, thing:getFluidType()) then
local effects = thing:getEffects(thing)
if effects[6] == 1 then
description = "You see a " .. apotency[tonumber(effects[4])].prefix .. " " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
elseif effects[6] == 2 then
description = "You see a " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
end
end
end
for i = 1, #aingredients do
if thing:getId() == aingredients[i].id then
description = "You see " .. thing:getDescription(distance) .. "\nEffects:\n1: "
if self:getStorageValue(aingredients[i].storages[1]) == 1 then
description = description .. aeffects[aingredients[i].effects[1]].fullname
else
description = description .. "Unknown"
end
description = description .. "\n2: "
if self:getStorageValue(aingredients[i].storages[2]) == 1 then
description = description .. aeffects[aingredients[i].effects[2]].fullname
else
description = description .. "Unknown"
end
end
end
And what occurs in game when you look at an item, post a pic or something.Code:function Player:onLook(thing, position, distance) local description = 'You see ' local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} if thing:getId() == 2006 then local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110} if isInArray(fluidType, thing:getFluidType()) then local effects = thing:getEffects(thing) if effects[6] == 1 then description = "You see a " .. apotency[tonumber(effects[4])].prefix .. " " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) elseif effects[6] == 2 then description = "You see a " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) end end end for i = 1, #aingredients do if thing:getId() == aingredients[i].id then description = "You see " .. thing:getDescription(distance) .. "\nEffects:\n1: " if self:getStorageValue(aingredients[i].storages[1]) == 1 then description = description .. aeffects[aingredients[i].effects[1]].fullname else description = description .. "Unknown" end description = description .. "\n2: " if self:getStorageValue(aingredients[i].storages[2]) == 1 then description = description .. aeffects[aingredients[i].effects[2]].fullname else description = description .. "Unknown" end end end
function Player:onLook(thing, position, distance)
local description = 'You see '
local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
if thing:getId() == 2006 then
local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}
if isInArray(fluidType, thing:getFluidType()) then
local effects = thing:getEffects(thing)
if effects[6] == 1 then
description = "You see a " .. apotency[tonumber(effects[4])].prefix .. " " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
elseif effects[6] == 2 then
description = "You see a " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
end
end
end
for i = 1, #aingredients do
if thing:getId() == aingredients[i].id then
description = "You see " .. thing:getDescription(distance) .. "\nEffects:\n1: "
if self:getStorageValue(aingredients[i].storages[1]) == 1 then
description = description .. aeffects[aingredients[i].effects[1]].fullname
else
description = description .. "Unknown"
end
end
end
if thing:isItem() then
if thing.actionid == 5640 then
description = description .. 'a honeyflower patch.'
elseif thing.actionid == 5641 then
description = description .. 'a banana palm.'
else
description = description .. thing:getDescription(distance)
end
else
description = description .. thing:getDescription(distance)
end
if self:getGroup():getAccess() then
if thing:isItem() then
description = string.format('%s\nItem ID: %d', description, thing.itemid)
local actionId = thing.actionid
if actionId ~= 0 then
description = string.format('%s, Action ID: %d', description, actionId)
end
local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID)
if uniqueId > 0 and uniqueId < 65536 then
description = string.format('%s, Unique ID: %d', description, uniqueId)
end
description = description .. '.'
local itemType = thing:getType()
local transformEquipId = itemType:getTransformEquipId()
local transformDeEquipId = itemType:getTransformDeEquipId()
if transformEquipId ~= 0 then
description = string.format('%s\nTransforms to: %d (onEquip)', description, transformEquipId)
elseif transformDeEquipId ~= 0 then
description = string.format('%s\nTransforms to: %d (onDeEquip)', description, transformDeEquipId)
end
local decayId = itemType:getDecayId()
if decayId ~= -1 then
description = string.format('%s\nDecays to: %d', description, decayId)
end
elseif thing:isCreature() then
local str = '%s\nHealth: %d / %d'
if thing:getMaxMana() > 0 then
str = string.format('%s, Mana: %d / %d', str, thing:getMana(), thing:getMaxMana())
end
description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. '.'
end
local position = thing:getPosition()
description = string.format(
'%s\nPosition: %d, %d, %d',
description, position.x, position.y, position.z
)
if thing:isCreature() and thing:isPlayer() then
description = string.format('%s\nIP: %s.', description, Game.convertIpToString(thing:getIp()))
end
end
self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end
function Player:onLookInBattleList(creature, distance)
local description = 'You see ' .. creature:getDescription(distance)
if self:getGroup():getAccess() then
local str = '%s\nHealth: %d / %d'
if creature:getMaxMana() > 0 then
str = string.format('%s, Mana: %d / %d', str, creature:getMana(), creature:getMaxMana())
end
description = string.format(str, description, creature:getHealth(), creature:getMaxHealth()) .. '.'
local position = creature:getPosition()
description = string.format(
'%s\nPosition: %d, %d, %d',
description, position.x, position.y, position.z
)
if creature:isPlayer() then
description = string.format('%s\nIP: %s.', description, Game.convertIpToString(creature:getIp()))
end
end
self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end
function Player:onLookInTrade(partner, item, distance)
local description = "You see " .. item:getDescription(distance)
local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
if item:getId() == 2006 then
local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}
if isInArray(fluidType, item:getFluidType()) then
local effects = item:getEffects(item)
if effects[6] == 1 then
description = "You see a " .. apotency[tonumber(effects[4])].prefix .. " " .. effects[5] .. ".\n" .. item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
elseif effects[6] == 2 then
description = "You see a " .. effects[5] .. ".\n" .. item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
end
end
end
for i = 1, #aingredients do
if item:getId() == aingredients[i].id then
description = "You see " .. item:getDescription(distance) .. "\nEffects:\n1: "
if self:getStorageValue(aingredients[i].storages[1]) == 1 then
description = description .. aeffects[aingredients[i].effects[1]].fullname
else
description = description .. "Unknown"
end
description = description .. "\n2: "
if self:getStorageValue(aingredients[i].storages[2]) == 1 then
description = description .. aeffects[aingredients[i].effects[2]].fullname
else
description = description .. "Unknown"
end
end
end
self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. description)
end
function Player:onLookInShop(itemType, count)
return true
end
if thing:isItem() then
if thing.actionid == 5640 then
description = description .. 'a honeyflower patch.'
elseif thing.actionid == 5641 then
description = description .. 'a banana palm.'
else
description = description .. thing:getDescription(distance)
end
else
description = description .. thing:getDescription(distance)
end
if thing:isItem() then
if thing.actionid == 5640 then
description = description .. 'a honeyflower patch.'
elseif thing.actionid == 5641 then
description = description .. 'a banana palm.'
else
if thing.itemid ~= 2006 or thing:getSubType() < 36 then
description = description .. thing:getDescription(distance)
end
end
else
description = description .. thing:getDescription(distance)
end
perfect thanks alotI'd say it's this part right here.
The first else statement is adding the actual item info to the end of the existing one.Code:if thing:isItem() then if thing.actionid == 5640 then description = description .. 'a honeyflower patch.' elseif thing.actionid == 5641 then description = description .. 'a banana palm.' else description = description .. thing:getDescription(distance) end else description = description .. thing:getDescription(distance) end
change it to
EDIT: change it to this instead, to prevent non-potion vials from breaking
Code:if thing:isItem() then if thing.actionid == 5640 then description = description .. 'a honeyflower patch.' elseif thing.actionid == 5641 then description = description .. 'a banana palm.' else if thing.itemid ~= 2006 or thing:getSubType() < 36 then description = description .. thing:getDescription(distance) end end else description = description .. thing:getDescription(distance) end
local description = 'You see '
if thing:isItem() then
if thing.actionid == 5640 then
description = description .. 'a honeyflower patch.'
elseif thing.actionid == 5641 then
description = description .. 'a banana palm.'
else
description = description .. thing:getDescription(distance)
end
else
description = description .. thing:getDescription(distance)
end
local description = 'You see '
if thing:isItem() then
if thing.actionid == 5640 then
description = description .. 'a honeyflower patch.'
elseif thing.actionid == 5641 then
description = description .. 'a banana palm.'
else
local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
if thing:getId() == 2006 then
local fluidType = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}
if isInArray(fluidType, thing:getFluidType()) then
local effects = thing:getEffects(thing)
if effects[6] == 1 then
description = "You see a " .. apotency[tonumber(effects[4])].prefix .. " " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
elseif effects[6] == 2 then
description = "You see a " .. effects[5] .. ".\n" .. thing:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
end
end
end
for i = 1, #aingredients do
if thing:getId() == aingredients[i].id then
description = "You see " .. thing:getDescription(distance) .. "\nEffects:\n1: "
if self:getStorageValue(aingredients[i].storages[1]) == 1 then
description = description .. aeffects[aingredients[i].effects[1]].fullname
else
description = description .. "Unknown"
end
description = description .. "\n2: "
if self:getStorageValue(aingredients[i].storages[2]) == 1 then
description = description .. aeffects[aingredients[i].effects[2]].fullname
else
description = description .. "Unknown"
end
end
end
end
else
description = description .. thing:getDescription(distance)
end
If you like this system, I also recommend checking out my crafting system.Interesting.
Any news on that?Alright so the bug I found is:
You may add an ingredient to the bowl, then exit out of the window, drop the item on the ground, go back into the window and then it will still be "in the bowl*" and useable without actually being removed from existence.
* - Upon entering the window again, the quantity will have changed from ( 1), to (-1)
I'll add a fix tonightAny news on that?
If you like this system, I also recommend checking out my crafting system.