I need a script for Mystic Spirit 0.2.5 that removes a certain item from the player that has just died, if that item is in the backpack.
nvm I got it working perfectly
YUS GOT IT!:
Regards,
Maaav
nvm I got it working perfectly
YUS GOT IT!:
LUA:
local bodycontainer = {}
local bagItems = {}
local containerSize = getContainerSize(corpse)
for count = 0, containerSize-1 do
bodycontainer[count] = getContainerItem(corpse, count)
if bodycontainer[count].itemid == 2345 then
doRemoveItem(bodycontainer[count].uid, 1)
end
if isItemContainer(bodycontainer[count].itemid) == TRUE then
doRemoveBagItems(bodycontainer[count].uid)
end
if bodycontainer[count].itemid == 7726 then
doRemoveItem(bodycontainer[count].uid, 1)
end
if isItemContainer(bodycontainer[count].itemid) == TRUE then
doRemoveBagItems(bodycontainer[count].uid)
end
if bodycontainer[count].itemid == 8694 then
doRemoveItem(bodycontainer[count].uid, 1)
end
if isItemContainer(bodycontainer[count].itemid) == TRUE then
doRemoveBagItems(bodycontainer[count].uid)
end
end
function doRemoveBagItems(bag)
local itemsInBag = {}
local bagSize = getContainerSize(bag)
for bagcount = 0, bagSize-1 do
itemsInBag[bagcount] = getContainerItem(bag, bagcount)
end
for bagcount = 0, bagSize-1 do
if itemsInBag[bagcount].itemid == 2345 then
doRemoveItem(itemsInBag[bagcount].uid, 1)
end
if itemsInBag[bagcount].itemid == 7726 then
doRemoveItem(itemsInBag[bagcount].uid, 1)
end
if itemsInBag[bagcount].itemid == 8694 then
doRemoveItem(itemsInBag[bagcount].uid, 1)
end
end
for bagcount = 0, bagSize-1 do
itemsInBag[bagcount] = getContainerItem(bag, bagcount)
end
for bagcount = 0, bagSize-1 do
itemsInBag[bagcount] = getContainerItem(bag, bagcount)
if isItemContainer(itemsInBag[bagcount].itemid) == TRUE then
doRemoveBagItems(itemsInBag[bagcount].uid)
end
end
end
Regards,
Maaav
Last edited: