The Cartooners Posted September 6, 2008 Share Posted September 6, 2008 I have created the following function: function EnableDrop() local txt = "" --Identify all Items within Cartridge local allItems = cartUphillChallenge:GetAllOfType('ZItem') txt = txt .. "Items: " .. table.getn(allItems) for _,item in ipairs(allItems) do item.Commands["Drop"].Enabled = true end end When I place the method call "EnableDrop" within the zone:OnEnter() event I receive the following error: enc:960 Attempt to index field 'Drop' (a nil value) I realise that there may not be any items within the zone and that some items may not have a command named 'Drop' Could that be the problem and if so how do I overcome this problem? Any idease please? Quote Link to comment
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.