Ir para conteúdo
  • 0

flavinhoo

Pergunta

Posts Recomendados

  • 0

ai vai ...

 

 

 

 

 

 

local SPECIAL_QUESTS = {2001}

 

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if(not isPlayer(cid)) then

return true

end

 

if(isContainer(item.uid)) then

if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then

return true

end

elseif(getTileInfo(position).creatures <= 1) then

return true

end

 

if(fromPosition.x == 0) then -- player just logged in

fromPosition = getTownTemplePosition(getPlayerTown(cid))

doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)

end

 

doTeleportThing(cid, fromPosition, true)

return true

end

Link para o comentário
Compartilhar em outros sites

  • 0

faza assim

 

local SPECIAL_QUESTS = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
return true
end
if(isContainer(item.uid)) then
if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then
return true
end
elseif getTileInfo(position.creatures) <= 1 then
return true
end
if(fromPosition.x == 0) then -- player just logged in
fromPosition = getTownTemplePosition(getPlayerTown(cid))
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
doTeleportThing(cid, fromPosition, true)
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

fiz e deu isso :

 

 

 

 

[20/10/2012 12:51:51] Lua Script Error: [MoveEvents Interface]

[20/10/2012 12:51:51] data/movements/scripts/walkback.lua:onStepIn

 

[20/10/2012 12:51:51] attempt to index a nil value

[20/10/2012 12:51:51] stack traceback:

[20/10/2012 12:51:51] [C]: in function 'getTileInfo'

[20/10/2012 12:51:51] data/movements/scripts/walkback.lua:10: in function <data/movements/scripts/walkback.lua:2>

 

Editado por flavinhoo
Link para o comentário
Compartilhar em outros sites

  • 0

então tente assim

 

local SPECIAL_QUESTS = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor, creatures)
if(not isPlayer(cid)) then
return true
end
if(isContainer(item.uid)) then
if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then
return true
end
elseif getTileInfo(position.creatures) == 1 then
return true
end
if(fromPosition.x == 0) then -- player just logged in
fromPosition = getTownTemplePosition(getPlayerTown(cid))
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
doTeleportThing(cid, fromPosition, true)
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

continua :

 

 

[20/10/2012 14:06:29] Lua Script Error: [MoveEvents Interface] 
[20/10/2012 14:06:29] data/movements/scripts/walkback.lua:onStepIn

[20/10/2012 14:06:29] attempt to index a nil value
[20/10/2012 14:06:29] stack traceback:
[20/10/2012 14:06:29]  [C]: in function 'getTileInfo'
[20/10/2012 14:06:30]  data/movements/scripts/walkback.lua:10: in function <data/movements/scripts/walkback.lua:2>

Link para o comentário
Compartilhar em outros sites

  • 0

veja assim acho que ja descobri

 

local SPECIAL_QUESTS = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
return true
end
if(isContainer(item.uid)) then
if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then
return true
elseif getTileInfo(position.creatures) == 1 then
end
return true
end
if(fromPosition.x == 0) then -- player just logged in
fromPosition = getTownTemplePosition(getPlayerTown(cid))
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
doTeleportThing(cid, fromPosition, true)
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

sky , continua aparecendo isso :

 

[20/10/2012 16:03:04] Lua Script Error: [MoveEvents Interface] 
[20/10/2012 16:03:04] data/movements/scripts/walkback.lua:onStepIn

[20/10/2012 16:03:04] attempt to index a nil value
[20/10/2012 16:03:04] stack traceback:
[20/10/2012 16:03:04]  [C]: in function 'getTileInfo'
[20/10/2012 16:03:04]  data/movements/scripts/walkback.lua:9: in function <data/movements/scripts/walkback.lua:2>

 

e agora qando vc passa em cima do bau nao volta !

Link para o comentário
Compartilhar em outros sites

  • 0

veja assim então

 

local SPECIAL_QUESTS = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor, creatures)
if(not isPlayer(cid)) then
return true
end
if(isContainer(item.uid)) then
if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then
return true
end
if getTileInfo(position.creatures) == 1 then
end
return true
end
if(fromPosition.x == 0) then -- player just logged in
fromPosition = getTownTemplePosition(getPlayerTown(cid))
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
doTeleportThing(cid, fromPosition, true)
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0
local specialQuests = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then return LUA_ERROR end

if isContainer(item.uid) and not isInArray(specialQuests, item.actionid) and item.uid > 65535 then

if getTileInfo(position).creatures > 0 then

for k, v in pairs(fromPosition) do
 if v == nil then
	 doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
		 end
			  end
				 end
					end
	return true	  
end

Editado por Skymagnum
Link para o comentário
Compartilhar em outros sites

  • 0

acho que agora vai.

 

local SPECIAL_QUESTS = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor, creatures)
if(not isPlayer(cid)) then
return true
end
if(isContainer(item.uid)) then
if(not isInArray(SPECIAL_QUESTS, item.actionid) and item.uid > 65535) then
return true
end
if(fromPosition.x == 0) then -- player just logged in
fromPosition = getTownTemplePosition(getPlayerTown(cid))
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
doTeleportThing(cid, fromPosition, true)
return true
end
end

Link para o comentário
Compartilhar em outros sites

  • 0

local specialQuests = {2001}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then return LUA_ERROR end

if isContainer(item.uid) and not isInArray(specialQuests, item.actionid) and item.uid > 65535 then 

if getTileInfo(position).creatures > 0 then 

if getPlayerStorageValue(cid, 321634) > 0 then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
setPlayerStorageValue(cid, 321634, 0)
end
end
end
return true
end

 

/data/creaturescripts/scripts

logoutTp

function onLogout(cid)

if getPlayerStorageValue(cid, 321634) < 1 then
setPlayerStorageValue(cid, 321634, 1)
end
return true
end

 

loginTp

 

function onLogin(cid)
if getPlayerStorageValue(cid, 321634) > 0 then
setPlayerStorageValue(cid, 321634, 0)
end
return true
end

 

creaturescripts.xml

<event type="login" name="pqVcFaiz" event="script" value="loginTp.lua"/>

<event type="logout" name="pqVcFas" event="script" value="logoutTp.lua"/>

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...