Re: Lua AddInventoryItem Error
I find it hard to believe that the code you posted results in the error you captured.
"Teleporter Particle" is a string, line of characters. Not a particle, mopixel, squid, or anything else but a string.
if you do
Code:
local part
part = CreateMOPixel("Teleporter Particle")
then part would be a pointer to MOPixel.
if actor:AddInventoryItem(part) fails, try actor:AddInventoryItem(ToMovableObject(part))
If adding a particle to every single actors inventory is what you want to do, then you'd need to:
Code:
function Create(self)
local part
for actor in MovableMan.Actors do
part = CreateMOPixel("Teleporter Particle")
actor:AddInventoryItem(part)
end
end
Why you'd want to do this, is beynond me, since no Lua updates are run outside MovableMan's direct ownership. (Ie. in an inventory)
Get your s... stuff straight, man.