- 18
- 1
Доброго времени дня. Я новичок в Lua. Решил написать скрипт для Trinity RP, который перемещает предметы из одной ячейки в другую. Как сделать так, что когда дойдет до 984 текстдрава, скрипт переключился на function gotovo(). Т.е после завершения переноса мне написало в чат "perenes".
Lua:
script_name("tralalelotralala")
script_version("crocodilobombardiro")
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage(string.format("%s %s loaded.", thisScript().name, thisScript().version), 0xFF9900)
sampRegisterChatCommand('croc',command)
while true do wait(0)
end
end
function command()
sampSendChat('/inv')
peretask()
end
function peretask()
array = {1028,1024,1020,1016,1012,1008,1004,1000,996,992,988,984}
for i, value in ipairs(array) do
sampSendClickTextdraw(value)
end
end
-- showtdid
function gotovo()
sampAddChatMessage("perenes", 0xFF9900)
end