This is what i'm trying to achieve
Code: Select all
if ARMOR_SLOT contains X_ARMOR then
-- execute code--
Code: Select all
if ARMOR_SLOT contains X_ARMOR then
-- execute code--
Code: Select all
playerarmor = player.get_inventory(defines.inventory.character_armor)[1]
if playerarmor and playerarmor.name == "Nameofsomearmor" then
dostuff
end
Jesus i did just the same without indexing [1]...Silari wrote: Fri Oct 01, 2021 2:16 amCode: Select all
playerarmor = player.get_inventory(defines.inventory.character_armor)[1] if playerarmor and playerarmor.name == "Nameofsomearmor" then dostuff end
Code: Select all
local armor = player.get_inventory(defines.inventory.character_armor)[1]
if armor.valid_for_read and armor.name == "ARMOR_NAME" then
-- EXECUTE CODE --
end