Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BlockShutdown.lua
- -- Function to block specific keys
- local function blockKeys()
- print("Blocking shutdown and reboot keys. Press Ctrl+C to stop the program.")
- while true do
- local event, key = os.pullEvent("key")
- -- Check if the key pressed is 'shutdown' (key code 24) or 'reboot' (key code 30)
- if key == keys.shutdown or key == keys.reboot then
- print("Shutdown or Reboot key pressed. Action blocked!")
- else
- print("Key pressed: " .. keys.getName(key))
- end
- end
- end
- -- Start blocking keys
- blockKeys()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement