Code: Select all
local function right_mouse_click(event)
local element = event.element --LuaGuiElement
local player_index = event.player_index --uint
local player = game.get_player(event.player_index)
local button = event.button --defines.mouse_button_type
local alt = event.alt --boolean
local control = event.control --boolean
local shift = event.shift --boolean
if element == {"button"} and player_index == player and button == defines.mouse_button_type.right and alt == false and control == false and shift == true then
player.character.damage(40, "player")
end
end
script.on_event(defines.events.on_gui_click, right_mouse_click)