хелпу по луа

hol0s

Участник
Автор темы
151
23
я вот не понимаю вроде написал все правильно, скрипт в консоли работает вроде а на деле нет
мой шедевролуакод:
require("lib.moonloader")

local vkeys = require("vkeys")

function main()
    while true do
        wait(0)
        if wasKeyPressed(vkeys.VK_NUMPAD1) then
            sampSendChat("holos squad domination")
        end
        if wasKeyPressed(vkeys.VK_NUMPAD2) then
            sampSendChat("/usedrugs 3")
        end
    end
end
 

kyrtion

Известный
661
242
if wasKeyPressed(vkeys.VK_NUMPAD1) then sampSendChat("holos squad domination") end if wasKeyPressed(vkeys.VK_NUMPAD2) then sampSendChat("/usedrugs 3") end
отслеживание на нажатие кнопки советую использовать callback-функцию onWindowMessage

А этот не нужно вызывать всех либов. Достаточно vkeys и всё
 
  • Клоун
Реакции: genius.company и MLycoris

ChromiusJ

PARΛDIGM ΛSS
Друг
4,923
3,203
нумпад включи
1713782338367.png
 
  • Bug
Реакции: hol0s

ChromiusJ

PARΛDIGM ΛSS
Друг
4,923
3,203
включен если ты про клаву, а не работает нихуя
Я ебу, все работает
Lua:
local vkeys = require('vkeys')
function main()
    while true do
        wait(0)
        if wasKeyPressed(vkeys.VK_NUMPAD1) then
            sampSendChat("holos squad domination")
        end
        if wasKeyPressed(vkeys.VK_NUMPAD2) then
            sampSendChat("/usedrugs 3")
        end
    end
end
Lua:
require('lib.moonloader') -- вариант 2
function main()
    while true do
        wait(0)
        if wasKeyPressed(VK_NUMPAD1) then
            sampSendChat("holos squad domination")
        end
        if wasKeyPressed(VK_NUMPAD2) then
            sampSendChat("/usedrugs 3")
        end
    end
end
 
  • Нравится
Реакции: MLycoris

hol0s

Участник
Автор темы
151
23
Я ебу, все работает
Lua:
local vkeys = require('vkeys')
function main()
    while true do
        wait(0)
        if wasKeyPressed(vkeys.VK_NUMPAD1) then
            sampSendChat("holos squad domination")
        end
        if wasKeyPressed(vkeys.VK_NUMPAD2) then
            sampSendChat("/usedrugs 3")
        end
    end
end
Lua:
require('lib.moonloader') -- вариант 2
function main()
    while true do
        wait(0)
        if wasKeyPressed(VK_NUMPAD1) then
            sampSendChat("holos squad domination")
        end
        if wasKeyPressed(VK_NUMPAD2) then
            sampSendChat("/usedrugs 3")
        end
    end
end
хз не играл, лучше перебиндю на другие клавиши