Custom OBS Script to Hide your map in the game Rust to stop from getting stream sniped
A Lua script for OBS Studio that instantly hides your map in Rust when pressing designated hotkeys. This script provides better response time than standard OBS hotkeys, ensuring your map is hidden immediately when needed.
- Instantly shows/hides a cover image when holding G or Shift+G
- Zero delay on both press and release
- Persists hotkey settings between OBS sessions
- Simple setup process
- OBS Studio (version 27.0.0 or newer recommended)
- A cover image source set up in OBS
- Download the
obs-map-hide.lua
script - In OBS Studio, go to Tools -> Scripts
- Click the + button and select the downloaded script
- Configure the script settings (see Setup below)
-
In OBS, create an image source that will cover your map:
- Click the + under Sources
- Select "Image"
- Name it "Map Hidden" (or your preferred name)
- Choose any image (solid color recommended)
- Position it to cover your map area
- Make sure it's hidden by default
-
In the Scripts window:
- Enter the exact name of your image source
- Make sure the source name matches exactly (it's case-sensitive)
-
Configure hotkeys:
- Go to Settings -> Hotkeys
- Find "Show Map Cover (Hold G)"
- Set it to G
- Find "Show Map Cover (Hold Shift+G)"
- Set it to Shift+G
- Click Apply
- Hold G or Shift+G to show the cover image
- Release the key to hide it
- The cover will appear and disappear instantly
If the script isn't working:
- Make sure the image source name matches exactly what you entered in the script settings
- Verify the hotkeys are properly set in OBS Settings -> Hotkeys
- Check the Scripts log window for any error messages
- Try restarting OBS if the source isn't being found
MIT License - Feel free to use and modify as needed.
Feel free to open issues or submit pull requests if you have suggestions for improvements.