Ir para conteúdo
  • 0

Erro script de tp


leandrozera

Pergunta

ola galera to com um problema quando todas salas de treiners estão lotadas aparece seguinte erro

[21/5/2015 15:18:20] [Error - MoveEvents Interface]
[21/5/2015 15:18:20] data/movements/scripts/trainingroom.lua:onStepIn
[21/5/2015 15:18:20] Description:
[21/5/2015 15:18:20] (luaGetThingPosition) Thing not found 

gostaria tb de por so para players level 50 entrar no tp

function onStepIn(cid, item, position, fromPosition)
for i = 2700, 3900 do
local pos = getThingPos(i)
if not isPlayer(getTopCreature(pos).uid) then
doTeleportThing(cid, pos)
doCreatureSay(cid, 'Using a tool to cast spells or to keep your character online is ok.', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
return true
end
doTeleportThing(cid, fromPosition, true)
doCreatureSay(cid, 'All training slots are taken', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end
return true
end

up

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

Sim arrumei aqui era um erro meu malz

Tenta assim:

local level = 50 -- level para passar

function onStepIn(cid, item, position, fromPosition)
	for i = 2700, 3200 do
		local pos = getThingfromPos(i)
		if not isPlayer(getTopCreature(pos).uid) and getPlayerLevel(cid) >= level then
			doTeleportThing(cid, pos)
			doCreatureSay(cid, 'Using a tool to cast spells or to keep your character online is ok.', TALKTYPE_ORANGE_1, false, cid)
			doSendMagicEffect(position, CONST_ME_TELEPORT)
			doSendMagicEffect(pos, CONST_ME_TELEPORT)
			return true
		end
		if getPlayerLevel(cid) < level then
			doCreatureSay(cid, 'You need level ' .. level .. ' to access the Trainers.', TALKTYPE_ORANGE_1, false, cid)
		else
			doCreatureSay(cid, 'All training slots are taken.', TALKTYPE_ORANGE_1, false, cid)
		end
		doTeleportThing(cid, fromPosition, true)
		doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
	end
	return true
end
Editado por Bruno Minervino
Link para o comentário
Compartilhar em outros sites

  • 0

 

Tenta assim:

local level = 50 -- level para passar

function onStepIn(cid, item, position, fromPosition)
	for i = 2700, 3200 do
		local pos = getThingfromPos(i)
		if not isPlayer(getTopCreature(pos).uid) and getPlayerLevel(cid) >= level then
			doTeleportThing(cid, pos)
			doCreatureSay(cid, 'Using a tool to cast spells or to keep your character online is ok.', TALKTYPE_ORANGE_1, false, cid)
			doSendMagicEffect(position, CONST_ME_TELEPORT)
			doSendMagicEffect(pos, CONST_ME_TELEPORT)
			return true
		end
		if getPlayerLevel(cid) < level then
			doCreatureSay(cid, 'You need level ' .. level .. ' to access the Trainers.', TALKTYPE_ORANGE_1, false, cid)
		else
			doCreatureSay(cid, 'All training slots are taken.', TALKTYPE_ORANGE_1, false, cid)
		end
		doTeleportThing(cid, fromPosition, true)
		doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		break
	end
	return true
end

só que agora so entra 1 player quando tento entrar com outro fala que ta lotada

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

  • 0

Editei, tenta ai

[21/5/2015 22:33:22] >>> Loading movements... [Error - LuaInterface::loadFile] data/movements/scripts/trainingroom.lua:21: '=' expected near 'end'
[21/5/2015 22:33:22] [Error - Event::checkScript] Cannot load script (data/movements/scripts/trainingroom.lua)
[21/5/2015 22:33:22] data/movements/scripts/trainingroom.lua:21: '=' expected near 'end'
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...