Помогите с луа кодом

Денис 2v.0

Участник
Автор темы
68
6
Здраствуйте, я начал учится луа скриптингу, написал свой первый скрипт с уроков, но он не работает, посмотрите пожалуйста и скажите в чем беда
function main()
whilee not isSampAvailable() do wait(100) end
sampRegisterChatCommand('teleport',command)
while true do wait(0) end end

function command()
bool,x,y,z = getTargetBlipCoordinates()
if bool then setCharCoordinates(playerPed,x,y,z) end end
 

Вложения

  • LUA.lua
    160 байт · Просмотры: 4

Double Tap Inside

Известный
Проверенный
1,898
1,252
А можешь сказать в чем ошибка?
Как минимум whilee - ошибка синтаксиса, такого слова нет, должно быть while.
Дикая табуляция в которой новичек запутается, даже мне ничего было не понятно, так что это пожалуй самое главное - делай красиво отступы.
В moonloader.log пишется где ошибка если что (и в консоли SampFuncs мб тоже)
 

Денис 2v.0

Участник
Автор темы
68
6
Привет следующий который уже нет, так вот, скрипт не мой, но я хочу туда добавить сообщение, попытался, но я сам не справюсь

Код:
require "lib.moonloader"

function main()
  if not isSampLoaded() or not isSampfunksloaded() then return end
  while not isSampAvailable() do wait(100) end

  sampAddchatmessage("Binder Loaded" 0xFFFF00) end

  repeat wait(0) until isSampAvailable()

  while true do
  wait(0)
    if isKeyJustPressed(VK_L) and not sampIsCursorActive() then
      sampSendChat("/lock")
    end
    if isKeyJustPressed(VK_K) and not sampIsCursorActive() then
      sampSendChat("/key")
    end
    if isKeyJustPressed(VK_P) and not sampIsCursorActive() then
      sampSendChat("/phone")
    end
  end
end
 

kizn

О КУ)))
Всефорумный модератор
2,405
2,055
Привет следующий который уже нет, так вот, скрипт не мой, но я хочу туда добавить сообщение, попытался, но я сам не справюсь

Код:
require "lib.moonloader"

function main()
  if not isSampLoaded() or not isSampfunksloaded() then return end
  while not isSampAvailable() do wait(100) end

  sampAddchatmessage("Binder Loaded" 0xFF) end

  repeat wait(0) until isSampAvailable()

  while true do
  wait(0)
    if isKeyJustPressed(VK_L) and not sampIsCursorActive() then
      sampSendChat("/lock")
    end
    if isKeyJustPressed(VK_K) and not sampIsCursorActive() then
      sampSendChat("/key")
    end
    if isKeyJustPressed(VK_P) and not sampIsCursorActive() then
      sampSendChat("/phone")
    end
  end
end
sampAddChatMessage, а не sampAddchatmessage. Правильное написание смотри на blast.hk/wiki
 

Денис 2v.0

Участник
Автор темы
68
6
В чат все равно не выводит, посмотри
Код:
require "lib.moonloader"

function main()
  if not isSampLoaded() or not isSampfunksloaded() then return end
  while not isSampAvailable() do wait(100) end

  sampAddChatMessage ("Binder loaded", -1) end

  repeat wait(0) until isSampAvailable()

  while true do
  wait(0)
    if isKeyJustPressed(VK_L) and not sampIsCursorActive() then
      sampSendChat("/lock")
    end
    if isKeyJustPressed(VK_K) and not sampIsCursorActive() then
      sampSendChat("/key")
    end
    if isKeyJustPressed(VK_P) and not sampIsCursorActive() then
      sampSendChat("/phone")
    end
  end
end
 

hashish

Известный
84
30
В чат все равно не выводит, посмотри
Код:
require "lib.moonloader"

function main()
  if not isSampLoaded() or not isSampfunksloaded() then return end
  while not isSampAvailable() do wait(100) end

  sampAddChatMessage ("Binder loaded", -1) end

  repeat wait(0) until isSampAvailable()

  while true do
  wait(0)
    if isKeyJustPressed(VK_L) and not sampIsCursorActive() then
      sampSendChat("/lock")
    end
    if isKeyJustPressed(VK_K) and not sampIsCursorActive() then
      sampSendChat("/key")
    end
    if isKeyJustPressed(VK_P) and not sampIsCursorActive() then
      sampSendChat("/phone")
    end
  end
end

*сверху* почти все плохо
телепорт и бинд которые ты пытался сделать
 

Вложения

  • bind.lua
    397 байт · Просмотры: 3
  • Teleport.lua
    513 байт · Просмотры: 2
Последнее редактирование: