'end' expected (to close 'for' at line 13) near '<eof>'

Firus20016

Участник
Автор темы
148
15
Версия MoonLoader
.025-beta
Приветствую всех. Просьба помочь с ошибкой в коде. Сразу говорю я тупенький)
Lua:
script_name('AutoRoulete')
script_author('FlipSize')
script_moonloader(023)
script_description('Автосбор рулеток на аризона рп')
require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  wait(1)
    if isKeyJustPressed(VK_P) then
            for loop = 0, 3000 do
            if sampTextdrawIsExists(loop) then print(loop)
            end
 
Последнее редактирование:
  • Нравится
Реакции: H1n9
Решение
Да, я уже пытался это учитывать, и пишет теперь вот это)
'end' expected (to close 'function' at line 7) near '<eof>'
Lua:
script_name('AutoRoulete')
script_author('FlipSize')
script_moonloader(023)
script_description('Автосбор рулеток на аризона рп')
require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  wait(1)
    if isKeyJustPressed(VK_P) then
        for loop = 0, 3000 do
            if sampTextdrawIsExists(loop) then
                print(loop)
            end
        end
       end
end
Пробуй добавлять\убирать end

Firus20016

Участник
Автор темы
148
15
Lua:
function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  wait(1)
    if isKeyJustPressed(VK_P) then
        for loop = 0, 3000 do
            if sampTextdrawIsExists(loop) then
                print(loop)
            end
        end
       end
end

Все функции надо закрывать
Да, я уже пытался это учитывать, и пишет теперь вот это)
'end' expected (to close 'function' at line 7) near '<eof>'
Lua:
script_name('AutoRoulete')
script_author('FlipSize')
script_moonloader(023)
script_description('Автосбор рулеток на аризона рп')
require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  wait(1)
    if isKeyJustPressed(VK_P) then
        for loop = 0, 3000 do
            if sampTextdrawIsExists(loop) then
                print(loop)
            end
        end
       end
end
 
  • Нравится
Реакции: H1n9

Joni Scripts

Известный
535
374
Да, я уже пытался это учитывать, и пишет теперь вот это)
'end' expected (to close 'function' at line 7) near '<eof>'
Lua:
script_name('AutoRoulete')
script_author('FlipSize')
script_moonloader(023)
script_description('Автосбор рулеток на аризона рп')
require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
  while true do
  wait(1)
    if isKeyJustPressed(VK_P) then
        for loop = 0, 3000 do
            if sampTextdrawIsExists(loop) then
                print(loop)
            end
        end
       end
end
Пробуй добавлять\убирать end
 
  • Нравится
Реакции: H1n9 и Firus20016

#Northn

Police Helper «Reborn» — уже ШЕСТЬ лет!
Всефорумный модератор
2,635
2,485
Табуляция создана для того, чтобы не случались такие ситуации.
Lua:
script_name('AutoRoulete')
script_author('FlipSize')
script_moonloader(023)
script_description('Автосбор рулеток на аризона рп')
require "lib.moonloader"

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        wait(1)
        if isKeyJustPressed(VK_P) then
            for loop = 0, 3000 do
                if sampTextdrawIsExists(loop) then
                    print(loop)
                end
            end
        end
    end
end
 
  • Нравится
Реакции: H1n9 и Firus20016