Ir para conteúdo

Featured Replies

Postado
  • Autor
  Em 03/03/2021 em 01:51, Vodkart disse:

 

seria isso que vc queria né:

 

 


local positions = {
	[999] = { -- pvp,
		{x = 1020, y = 1200, z = 7},
		{x = 1200, y = 929, z = 7},
		{x = 1201, y = 1201, z = 7}
	},
	[1000] = { -- food
		{x = 1000, y = 1000, z = 7},
		{x = 1000, y = 999, z = 7},
		{x = 1001, y = 1001, z = 7}
	},
	[1001]= { -- ice
		{x = 1230, y = 1000, z = 7},
		{x = 1230, y = 999, z = 7},
		{x = 1001, y = 1001, z = 7}
	}
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if not isPlayer)cid) then return true end
	local ret = positions[item.actionid]
	if not ret then return true end
	doTeleportThing(cid, ret[math.random(1, #ret)])
	return true
end

 

Aham, o seu deu 
[22:58:41.791] [Error - LuaInterface::loadFile] data/movements/scripts/food.lua:19: 'then' expected near ')'
[22:58:41.791] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/food.lua)
[22:58:41.791] data/movements/scripts/food.lua:19: 'then' expected near ')'

  • Respostas 14
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Na verdade o teu script original pega uma posição randômica entre as 3 da lista, por isso perguntei. Mas tu pode fazer assim:   local positions = { [999] = { {x = 1000, y = 1000, z = 7} },

  • acho que é igual kkk nem vi

Postado
  Em 03/03/2021 em 01:59, XGaduX disse:

Aham, o seu deu 
[22:58:41.791] [Error - LuaInterface::loadFile] data/movements/scripts/food.lua:19: 'then' expected near ')'
[22:58:41.791] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/food.lua)
[22:58:41.791] data/movements/scripts/food.lua:19: 'then' expected near ')'

 kkk na hora de colocar isPlayer(cid) eu botei isPlayer)cid) kkk

 

 

ta aqui arrumado:

 

local positions = {
	[999] = { -- pvp,
		{x = 1020, y = 1200, z = 7},
		{x = 1200, y = 929, z = 7},
		{x = 1201, y = 1201, z = 7}
	},
	[1000] = { -- food
		{x = 1000, y = 1000, z = 7},
		{x = 1000, y = 999, z = 7},
		{x = 1001, y = 1001, z = 7}
	},
	[1001]= { -- ice
		{x = 1230, y = 1000, z = 7},
		{x = 1230, y = 999, z = 7},
		{x = 1001, y = 1001, z = 7}
	}
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if not isPlayer(cid) then return true end
	local ret = positions[item.actionid]
	if not ret then return true end
	doTeleportThing(cid, ret[math.random(1, #ret)])
	return true
end

 

Postado
  • Autor
  Em 03/03/2021 em 02:09, Vodkart disse:

 kkk na hora de colocar isPlayer(cid) eu botei isPlayer)cid) kkk

 

 

ta aqui arrumado:

 


local positions = {
	[999] = { -- pvp,
		{x = 1020, y = 1200, z = 7},
		{x = 1200, y = 929, z = 7},
		{x = 1201, y = 1201, z = 7}
	},
	[1000] = { -- food
		{x = 1000, y = 1000, z = 7},
		{x = 1000, y = 999, z = 7},
		{x = 1001, y = 1001, z = 7}
	},
	[1001]= { -- ice
		{x = 1230, y = 1000, z = 7},
		{x = 1230, y = 999, z = 7},
		{x = 1001, y = 1001, z = 7}
	}
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if not isPlayer(cid) then return true end
	local ret = positions[item.actionid]
	if not ret then return true end
	doTeleportThing(cid, ret[math.random(1, #ret)])
	return true
end

 

rs, o que muda do seu script para o do Rusherzin?

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo