How to make item appear after interacting with sprite

This is my first time making a game, and i am trying to make some npcs drop a key, i figured out how to hide the key on game start but i can not figure out how to make it reappear after talking to the npcs, any help?

I think you need something like this on the npcs. Let me know if it works or if you need something more specific.

on interact do
    say "your dialogue" then
      tell keyX,keyY to //replace with your coordinates or have these variables set
        swap "key-tile" //put the name of your key tile here
      end
    end
end
1 Like

thank you so much that worked

1 Like