F
F
Fakes2021-01-16 13:08:07
Lua
Fakes, 2021-01-16 13:08:07

How to make a condition for Jua?

require "lib.moonloader"

local keys = require "vkeys"

function main()

  if not isSampLoaded() or not isSampfuncsLoaded()
    then return
  end

  while not isSampAvailable()
  do
    wait()
  end

  sampAddChatMessage('CarHelp активен', 0x800080)

  while true do
    wait(0)

    if isKeyJustPressed(VK_L)
    then 
      sampSendChat('/lock')
    elseif isKeyJustPressed(VK_K)
    then
      sampSendChat('/key')
    end

  end

end


Tell me here the condition that when opening a chat in the game, lua would not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Fott, 2021-02-08
@dimkafmlovediankafm

if isKeyJustPressed(VK_L) and not sampIsChatInputActive() then 
      sampSendChat('/lock')
elseif isKeyJustPressed(VK_K) and not sampIsChatInputActive() then
      sampSendChat('/key')
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question