Ir para conteúdo

Featured Replies

Postado
  • Solução
Configs = {
	RestrictNames = {"gm fulano de tal"} -- lista de nomes proibidos para se usar /goto
}

local function tableContains(table, value)
	for index = 1, #table do
		if table[index]:lower() == value:lower() then
			return true
		end
	end
end

function onSay(cid, words, param)
	local player = Player(cid)
	if getPlayerGroupId(cid) > 3 then
		local target = Creature(param)
		if target == nil or tableContains(Configs.RestrictNames, player:getName()) then
			player:sendCancelMessage("Creature not found.")
			return false
		end
		
		player:teleportTo(target:getPosition())
		return false
	end
end
Configs = {
	RestrictNames = {"gm fulano de tal"}
}

local function tableContains(table, value)
	for index = 1, #table do
		if table[index]:lower() == value:lower() then
			return true
		end
	end
end

function onSay(player, words, param)
	if not player:getGroup():getAccess() then
		return true
	end

	local creature = Creature(param)
	if not creature or tableContains(Configs.RestrictNames, player:getName()) then
		player:sendCancelMessage("A creature with that name could not be found.")
		return false
	end

	local oldPosition = creature:getPosition()
	local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
	if newPosition.x == 0 then
		player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
		return false
	elseif creature:teleportTo(newPosition) then
		if not creature:isInGhostMode() then
			oldPosition:sendMagicEffect(CONST_ME_POFF)
			newPosition:sendMagicEffect(CONST_ME_TELEPORT)
		end
	end
	return false
end

 

ichigo.gif
https://github.com/Cjaker/

  , _ ,
 ( o o )
/'` ' `'\                     ESTOU TE OBSERVANDO O_O
|'''''''|
|\\'''//|
   """

 

  • Respostas 12
  • Visualizações 586
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Makhai Drakon
    Makhai Drakon

    @SouDeus Mano Se for dar umas respostas dessa e melhor ficar queto não acha ? @Andreeyyy Testei não mano adicionei a função de vem quais são as restrições   Bom aproveito! /goto function

  • Configs = { RestrictNames = {"gm fulano de tal"} -- lista de nomes proibidos para se usar /goto } local function tableContains(table, value) for index = 1, #table do if table[index]:lower() == va

  • Makhai Drakon
    Makhai Drakon

    @Andreeyyy  function onSay(cid, words, param) local restricao = {"Demon","Fire Devil"} for r = 1, #restricao do if param == restricao[r]then player:sendCancelMessage("Você não pode usar isto diga

Postado
  • Autor

@Ckfox 

[Warning - Event::checkScript] Can not load script: scripts/teleport_to_creature.lua
data/talkactions/scripts/teleport_to_creature.lua:19: 'then' expected near 'player'

@Cjaker 
Amor, não deu boa, ele continua aceitando o TP

Postado

@Andreeyyy 

function onSay(cid, words, param)
local restricao = {"Demon","Fire Devil"}

for r = 1, #restricao do
if param == restricao[r]then
player:sendCancelMessage("Você não pode usar isto diga /goto restricao")
return true
end

if param == "restricao" then
player:sendCancelMessage(restricao[r])
return true
end

	local player = Player(cid)
	if getPlayerGroupId(cid) > 3 then

	local target = Creature(param)
	if target == nil then
		player:sendCancelMessage("Creature not found.")
		return false
	end

	player:teleportTo(target:getPosition())
	return false
end
end
end
----------------------------------------------------------------------------------------

function onSay(player, words, param)

local restricao = {"Demon","Fire Devil"}

for r = 1, #restricao do
if param == restricao[r]then
player:sendCancelMessage("Você não pode usar isto diga /c restricao")
return true
end

if param == "restricao" then
player:sendCancelMessage(restricao[r])
return true
end
	if not player:getGroup():getAccess() then
		return true
	end

	local creature = Creature(param)
	if not creature then
		player:sendCancelMessage("A creature with that name could not be found.")
		return false
	end

	local oldPosition = creature:getPosition()
	local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
	if newPosition.x == 0 then
		player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
		return false
	elseif creature:teleportTo(newPosition) then
		if not creature:isInGhostMode() then
			oldPosition:sendMagicEffect(CONST_ME_POFF)
			newPosition:sendMagicEffect(CONST_ME_TELEPORT)
		end
	end
	return false
end
end

 

Editado por Ckfox (veja o histórico de edições)

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

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