press "E" near trigger use I looked other comments but I didnt understand.
I want to make this:
example:
Press"e" then
equip id deagle(weapon id = 3)
Sorry for bad english

Thanks for helps.

addhook("use","gunZ")
function gunZ()
if trigger == usetrigger1 then
parse(spawnitem 1 11 88)
end
end
addhook("say","lol")
function lol(id,txt)
if(txt=="!equip") then
parse("equip "..id.." 1")
parse("spawnitem 1 11 88")
end
end
function contains(table, element)
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
addhook("usebutton","megabutton")
function megabutton(id,x,y)
if (x==BUTTONTILEX and y==BUTTONTILEY) then
for i=1,6 do
if (contains(playerweapons(id),i)) then
parse("strip "..id.." "..i)
parse("spawnitem "..i.." "..player(id,"tilex").." "..player(id,"tiley"))
parse("equip "..id.." 4")
end
end
end
end