Помогите починить lua

ScripTER 2.0

Участник
Автор темы
106
4
Кто может починить мой скрипт не работает в консоли ошибка
не могу понять в чем проблема
[21:13:46.325429] (error) AutoScripts.lua: D:\green0308\moonloader\AutoScripts.lua:42: unexpected symbol near '/'
[21:13:46.325429] (error) AutoScripts.lua: Script died due to an error. (0EA6ED84)

[21:28:43.708196] (error) AutoScripts.lua: D:\green0308\moonloader\AutoScripts.lua:40: unexpected symbol near '/'
[21:28:43.709195] (error) AutoScripts.lua: Script died due to an error. (11002DB4)


Код:
local sampev = require 'samp.events'
local sampev = require "lib.samp.events"

function sampev.onServerMessage(color, text)
    -- Проверка на текст
    if text:find('mq') or text:find('MQ') then
        -- Поиск айди игрока
        local id = tonumber(text:match('%((%d+)%)'))
        if id then
            lua_thread.create(function() wait(120) -- Любая задержка больше 1.000 не ставить!
            sampProcessChatInput('/or ' .. id) -- Команда ID Игрока!
            end)
        end
    end
end
function sampev.onServerMessage(clr, text)
    if text:find("%[.%] (.+)%((%d+)%) не авторизовался как администратор уже") then
        lua_thread.create(function()
            nick, id = text:match("%[.%] (.+)%((%d+)%) не авторизовался как администратор уже")
            wait(120) -- Любая задержка больше 1.000 не ставить!
            sampProcessChatInput("/al "..tostring(id)) -- Команда ID Игрока!
        end)
    end
end
function sampev.onServerMessage(color, text)
    text = text:gsub("{……}","")
    if text:find('%[VIP чат%] (.+)%[(%d+)%]: (.+)') then
        local nick, id, msg = text:match('%[VIP чат%] (.+)%[(%d+)%]: (.+)')
        id = tonumber(id)
        if id and msg:find("mq") or text:find('MQ') then
            lua_thread.create(function()
                wait(120) -- Любая задержка больше 1.000 не ставить!
                sampProcessChatInput('/or ' .. id) -- Команда ID Игрока!
            end)
        end
    end
end
 
Последнее редактирование:
Решение
Я не понимаю смысл этих двух функций конечно и похуй что они от одного хука
1688842132785.png

Lua:
local sampev = require 'samp.events'

function sampev.onServerMessage(color, text)
    if text:find('mq') or text:find('MQ') then
        local id = tonumber(text:match('%((%d+)%)'))
        if id then
            lua_thread.create(function()
                wait(120)
                sampProcessChatInput('/or ' .. id)
            end)
        end
    elseif text:find("%[VIP чат%] (.+)%[(%d+)%]: (.+)") then
        local nick, id, msg = text:match("%[VIP чат%] (.+)%[(%d+)%]: (.+)")
        id = tonumber(id)
        if id and msg:find("mq") or text:find('MQ') then
            lua_thread.create(function()
                wait(120)...

ChromiusJ

Известный
Друг
4,897
3,184
Я не понимаю смысл этих двух функций конечно и похуй что они от одного хука
1688842132785.png

Lua:
local sampev = require 'samp.events'

function sampev.onServerMessage(color, text)
    if text:find('mq') or text:find('MQ') then
        local id = tonumber(text:match('%((%d+)%)'))
        if id then
            lua_thread.create(function()
                wait(120)
                sampProcessChatInput('/or ' .. id)
            end)
        end
    elseif text:find("%[VIP чат%] (.+)%[(%d+)%]: (.+)") then
        local nick, id, msg = text:match("%[VIP чат%] (.+)%[(%d+)%]: (.+)")
        id = tonumber(id)
        if id and msg:find("mq") or text:find('MQ') then
            lua_thread.create(function()
                wait(120)
                sampProcessChatInput('/or ' .. id)
            end)
        end
    elseif text:find("%[.%] (.+)%((%d+)%) не авторизовался как администратор уже") then
        lua_thread.create(function()
            local nick, id = text:match("%[.%] (.+)%((%d+)%) не авторизовался как администратор уже")
            wait(120)
            sampProcessChatInput("/al " .. tostring(id))
        end)
    end

    text = text:gsub("{……}", "")
end
 
  • Нравится
Реакции: Heav

ScripTER 2.0

Участник
Автор темы
106
4
Я не понимаю смысл этих двух функций конечно и похуй что они от одного хука
Посмотреть вложение 207364
Lua:
local sampev = require 'samp.events'

function sampev.onServerMessage(color, text)
    if text:find('mq') or text:find('MQ') then
        local id = tonumber(text:match('%((%d+)%)'))
        if id then
            lua_thread.create(function()
                wait(120)
                sampProcessChatInput('/or ' .. id)
            end)
        end
    elseif text:find("%[VIP чат%] (.+)%[(%d+)%]: (.+)") then
        local nick, id, msg = text:match("%[VIP чат%] (.+)%[(%d+)%]: (.+)")
        id = tonumber(id)
        if id and msg:find("mq") or text:find('MQ') then
            lua_thread.create(function()
                wait(120)
                sampProcessChatInput('/or ' .. id)
            end)
        end
    elseif text:find("%[.%] (.+)%((%d+)%) не авторизовался как администратор уже") then
        lua_thread.create(function()
            local nick, id = text:match("%[.%] (.+)%((%d+)%) не авторизовался как администратор уже")
            wait(120)
            sampProcessChatInput("/al " .. tostring(id))
        end)
    end

    text = text:gsub("{……}", "")
end
теперь работать будет?
 
  • Bug
Реакции: Vespan