local keys = { GetKey('Q'), GetKey('W'), GetKey('E'), GetKey('R') } local press = { false, false, false, false } print("1") function OnWndMsg(msg, key) for i, v in ipairs(keys) do print("2") if key == v then print("3") if msg == KEY_DOWN then print("4") press[i] = true elseif msg == KEY_UP then print("5") press[i] = false end end end end function OnSendPacket(p) if p.header == Packet.headers.S_CAST then print("6") local decodedPacket = Packet(p) p:Block() local spellId = decodedPacket:get('spellId') if spellId ~= nil and spellId >= 0 and spellId <= 3 and not press[spellId + 1] then print("7") Packet('S_CAST', { decodedPacket }):send() end end end