I have two pickable items named card and gem and I want to be able to tell when they're picked up and make pointers over each item disappear. I'm using this script to do that:
However, when I do that, it errors Error: In on_update: [string "maps/street_arspace.lua"]:79: attempt to index field 'card' (a nil value), line 79 being if not map.card:exists() then. Any suggestion for what I'm doing wrong?
It also for some reason doesn't work without that extra end there. I'm not sure what's up with that.
Code (lua) Select
function map:on_update()
if not map.card:exists() then
cardpoint:remove()
print("Card removed!")
else if not map.gem:exists() then
gempoint:remove()
print("Gem removed!")
end
end
end
However, when I do that, it errors Error: In on_update: [string "maps/street_arspace.lua"]:79: attempt to index field 'card' (a nil value), line 79 being if not map.card:exists() then. Any suggestion for what I'm doing wrong?
It also for some reason doesn't work without that extra end there. I'm not sure what's up with that.