How to make an item unusable when not in world map or save points?

as the title, that i need to make an item ''Tent'' available only when standing at save points or world map.
if anyone know how to, then can you help me?
many thanks.
There may be an easier way to do this with a script call or something, but the way I know how is as follows:

When on the world map or save point, have an event turn on a switch and turn it off when the player leaves. Then, setup a common event so that the tent is only useable if the switch is on using a Conditional Branch. You can also have a message appear if the switch is not on using the 'Else' branch. Something like 'You can only use this item at the world map or at a save point.'

Hopefully that makes sense. Like I said, there may be a more streamlined way to do this, or even a plugin.
Standing at save points? You mean near or standing above an event which is a save point? If you're taking about standing on top of an event then in the event that is acting as a save point, add the tent item. You can make other events around that event with player touch trigger to reduce the tent to zero. And in the world map, make a parallel event, add tent then set self switch to A. Make a new page, set page condition to self switch A. In the events that transfer the player to another map, add reduce tent before transfer. This is all that I can think of right now. Sorry for my english, I'm so sleepy I don't know what I'm typing.

*Edit* oh you mean unusable... the item will be in the inventory but unusable? Then, set a common event to the item type and in that common event check if the current map id is equal to the map id of world map. If it is, then let player use tent. If not, then dont. You can check location of player with player map x and map y too to see if player is standing on save point.
thank you guys! i will try your suggestions.
Use a region id to draw on all the tiles around save points where the player could stand, where the tent item would be enabled.

Create a common event and attach it to the tent item.

Check to see if you're on the world map (I think you can use Control Variables to get the current map id, then a conditional branch to compare it to the world map id, which you'll have to enter - no leading zeros). If you are, the tent item is enabled. In the Else section, use Control Variables to get the player's current X and Y coordinate, followed by Get Location Info to get the region id of those coordinates. Then another conditional branch to see if the region id is the one you used around all your save points. If it is, the tent item is enabled.

If it's enabled, do whatever you want to do when they use it - just do the sleep & regenerate, or if you're being fancy, save the map, x and y to a variable, teleport to a new map for the tent, and when they leave, teleport back to the map, x and y variables. If it's not enabled, just show a message. And of course, make the tent item non-consumable.
If you were only using save points, the easiest way is to just have "Use Tent" appear as a choice if you have any tents in your inventory instead of using them from the menu.

You could set it up so there are two identical "Tent" items, one usable and the other unusable. Only give the player unusable ones (For development reasons, it's better to keep them different names until the game is finished).
On the world map, have an autorun event that replaces all the tents for usable ones, turns on a switch (Label it "Usable Tents" or something), then erases itself.
Make a Common Event that's Parallel Process and uses that switch to turn on. In the event, have it check if your Map ID is the world ID. When it's not, it'll replace the tents again (unusable), then turn the switch off.
For save points that you walk onto instead of activate, use the function that lets the player save (most likely the apparent save point) to also switch the tents for usable ones, and switches them with unusable ones with the function that disallows saving.

If you are willing to use plugins, I believe Yanfly has one that allows restriction of item use. In the restriction, have it check to see if saving is allowed to make Tent use allowed.
Use a region id to draw on all the tiles around save points where the player could stand, where the tent item would be enabled.

Create a common event and attach it to the tent item.

Check to see if you're on the world map (I think you can use Control Variables to get the current map id, then a conditional branch to compare it to the world map id, which you'll have to enter - no leading zeros). If you are, the tent item is enabled. In the Else section, use Control Variables to get the player's current X and Y coordinate, followed by Get Location Info to get the region id of those coordinates. Then another conditional branch to see if the region id is the one you used around all your save points. If it is, the tent item is enabled.

If it's enabled, do whatever you want to do when they use it - just do the sleep & regenerate, or if you're being fancy, save the map, x and y to a variable, teleport to a new map for the tent, and when they leave, teleport back to the map, x and y variables. If it's not enabled, just show a message. And of course, make the tent item non-consumable.
Now that is an epic reply 🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-item-unusable-when-not-in-world-map-or-save-points.86031/