помогите lua

rertlop

Участник
Автор темы
47
3
Скрипт работает только если перезарузить скрипты, а по команде не работает. помогите
код:
local sampev = require "lib.samp.events"

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    
    sampRegisterChatCommand('go', go_cmd)
        setCharCoordinates(PLAYER_PED, -197.18, 496.96, 12.48)
        wait(1500)
        setCharCoordinates(PLAYER_PED, -181.72, 493.99, 12.48)
        wait(1500)
    while true do
        wait(-1)
    end
end
 

accord-

Потрачен
437
79
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Lua:
local sampev = require("lib.samp.events")

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    
    sampRegisterChatCommand('go', go_cmd)
    
    wait(-1)
end

function go_cmd()
    lua_thread.create(function()   
        setCharCoordinates(PLAYER_PED, -197.18, 496.96, 12.48)
        wait(1500)
        setCharCoordinates(PLAYER_PED, -181.72, 493.99, 12.48)
        wait(1500)
    end)
end
 
  • Нравится
Реакции: YarikVL и rertlop

cord

contact me → cordtech.ru
Проверенный
557
410
Lua:
local sampev = require("lib.samp.events")

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
   
    sampRegisterChatCommand('go', go_cmd)
   
    wait(-1)
end

function go_cmd()
    lua_thread.create(function()  
        setCharCoordinates(PLAYER_PED, -197.18, 496.96, 12.48)
        wait(1500)
        setCharCoordinates(PLAYER_PED, -181.72, 493.99, 12.48)
        wait(1500)
    end)
end
Lua:
local sampev = require("lib.samp.events")
local active = false
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    
    sampRegisterChatCommand('go',function()
active = not active 
end)
    
    wait(0)
if active then 
setCharCoordinates(PLAYER_PED, -197.18, 496.96, 12.48)

        wait(1500)

        setCharCoordinates(PLAYER_PED, -181.72, 493.99, 12.48)

        wait(1500)
end 
end

Ой, Как-то криво получилось😅
 
  • Эм
Реакции: YarikVL