Oia legal...
As do array vai me ser util futuramente
Apesar que vou usar mais como ensinamento já que tudo que sei sobre LUA
é voltado pra otserver e eu até pretendo aprender + sobre
Muito bom
info
Grupo: Conde
Registrado: 18/12/05
Posts: 912
Reputação: +86
Gênero: Masculino
Char no Tibia: Kohzete

Oia legal...
As do array vai me ser util futuramente
Apesar que vou usar mais como ensinamento já que tudo que sei sobre LUA
é voltado pra otserver e eu até pretendo aprender + sobre
Muito bom
info
Grupo: Marquês
Registrado: 01/03/06
Posts: 1k
Reputação: +38
Gênero: Masculino

Boa, achei interessante a changeLookDir(cid, dir), não sabia que dava pra fazer assim, principalmente pelo 3° parâmetro, boas functions ![]()
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Cavaleiro
Registrado: 07/10/08
Posts: 189
Reputação: +23
funções:
Library:--[[ ------------------------------------------------------ Eventide Script Library Version: 1 Author: Gustavo Junqueira (Eventide) ------------------------------------------------------- ]] function addNumberOnArray(array, number) for ret = 1,table.getn(array) do if type(array[ret]) == number then array[ret] + number end end end function getArrPosByName(array, name) for ret = 1,table.getn(array) do if array[ret] == name then return ret break end end end function isPlayerOnArea(name, alt, lar, esq) if getPlayerPosition(getPlayerByName(name)) == esq then return TRUE else for T = 1,alt do Pos = {x = esq.x, y = esq.y + T, z = esq.z} if getPlayerPosition(getPlayerByName(name)) == Pos then return TRUE end end for T = 1,lar do if lar == alt then Pos = {x = esq.x - T, y = esq.y + T, z = esq.z} if getPlayerPosition(getPlayerByName(name)) == Pos then return TRUE end else for U = 1,alt do Pos = {x = esq.x - T, y = esq.y + U, z = esq.z} if getPlayerPosition(getPlayerByName(name)) == Pos then return TRUE end end end end end end function getCountOnArr(array, search) count = {0} for T = 1,#array do if array[T] == search table.insert(count, 0) end end final = #count return final end function doCalculateArray(array, calc) if calc == plus then final = math.floor(string.explode(table.concat(array, "+"))) elseif calc == less then final = math.floor(string.explode(table.concat(array, "-"))) elseif calc == mult then final = math.floor(string.explode(table.concat(array, "*"))) elseif calc == div then final = math.floor(string.explode(table.concat(array, "/"))) else return FALSE end return final end function changeLookDir(cid, dir) pp = getPlayerPosition(cid) if dir == north then tp1 = {x = pp.x, y = pp.y - 1, z = pp.z} tp2 = {x = pp.x, y = pp.y + 1, z = pp.z} doTeleportThing(cid, tp1, TRUE) doTeleportThing(cid, tp2, FALSE) elseif dir == south then tp1 = {x = pp.x, y = pp.y + 1, z = pp.z} tp2 = {x = pp.x, y = pp.y - 1, z = pp.z} doTeleportThing(cid, tp1, TRUE) doTeleportThing(cid, tp2, FALSE) elseif dir == right then tp1 = {x = pp.x - 1, y = pp.y, z = pp.z} tp1 = {x = pp.x + 1, y = pp.y, z = pp.z} doTeleportThing(cid, tp1, TRUE) doTeleportThing(cid, tp2, FALSE) elseif dir == left then tp1 = {x = pp.x + 1, y = pp.y, z = pp.z} tp1 = {x = pp.x - 1, y = pp.y, z = pp.z} doTeleportThing(cid, tp1, TRUE) doTeleportThing(cid, tp2, FALSE) else return FALSE end endpara instalar simplesmente copie e cole isso no seu global.lua
caso seu server seja TFS 0.3, va na pasta data/lib e cole a library no arquivo function.lua
Editado Janeiro 2 por Eventide