легкая помощь

SpinQuatts

Известный
Автор темы
52
2
Версия MoonLoader
.026-beta
Мне нужно, чтобы при нажатии клавиши мой скрипт выполнял действие
 
Решение
Lua:
                                if teste1 and isKeyJustPressed (0x31) then
wait(1000)
sampSendChat('hi1')

               
                        elseif teste1 and isKeyJustPressed (0x32) then
wait(10)
sampSendChat('hi2')

               
                        elseif teste1 and isKeyJustPressed (0x33) then
wait(10)
sampSendChat('hi5')

               
                        elseif teste1 and isKeyJustPressed (0x34) then
wait(10)
sampSendChat('hi4')
end

Потому что это не работает?
Lua:
function main()
    while true do
        wait(0)
        if teste1 then
            if isKeyJustPressed(0x31) then
                wait(1000)
                sampSendChat('hi1')
            elseif isKeyJustPressed(0x32) then...

SpinQuatts

Известный
Автор темы
52
2
Lua:
                                if teste1 and isKeyJustPressed (0x31) then
wait(1000)
sampSendChat('hi1')

                
                        elseif teste1 and isKeyJustPressed (0x32) then
wait(10)
sampSendChat('hi2')

                
                        elseif teste1 and isKeyJustPressed (0x33) then
wait(10)
sampSendChat('hi5')

                
                        elseif teste1 and isKeyJustPressed (0x34) then
wait(10)
sampSendChat('hi4')
end

Потому что это не работает?
 

CaJlaT

07.11.2024 14:55
Модератор
2,848
2,695
Lua:
                                if teste1 and isKeyJustPressed (0x31) then
wait(1000)
sampSendChat('hi1')

               
                        elseif teste1 and isKeyJustPressed (0x32) then
wait(10)
sampSendChat('hi2')

               
                        elseif teste1 and isKeyJustPressed (0x33) then
wait(10)
sampSendChat('hi5')

               
                        elseif teste1 and isKeyJustPressed (0x34) then
wait(10)
sampSendChat('hi4')
end

Потому что это не работает?
Lua:
function main()
    while true do
        wait(0)
        if teste1 then
            if isKeyJustPressed(0x31) then
                wait(1000)
                sampSendChat('hi1')
            elseif isKeyJustPressed(0x32) then
                wait(10)
                sampSendChat('hi2')
            elseif isKeyJustPressed(0x33) then
                wait(10)
                sampSendChat('hi5')
            elseif isKeyJustPressed(0x34) then
                wait(10)
                sampSendChat('hi4')
            end
        end
    end
end
 
  • Нравится
Реакции: SpinQuatts