Ir para conteúdo

Featured Replies

  • Respostas 22
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = { targetList = { [1] = 'purching bag' }, access = 3 -- Gamemaster } function onPush(cid, target) if getPlayerAccess(cid) >= config.access then return true end if target =

Posted Images

Postado

@lordzetros no caso só criar com a função getCreatureTarget(target)

ao dar target em tal bixo não pode mover

local targetList = {"Purching Bag"}
	function onPush(cid, target)
	        if((target ~= cid and isPlayer(target)) and (getCreatureTarget(target) > 0 and isInArray(targetList, getCreatureName(getCreatureTarget(target)):lower()))) then
	            doPlayerSendCancel(cid, "You cannot move this object.")
	            return false
	    end
	    return true
	end

 

Postado
local config = {
	targetList = {
		[1] = 'purching bag',
		-- [2] = 'outro nome de criatura' <= exemplo
	}

	access = 3 -- Gamemaster
}

function onPush(cid, target)
	if getPlayerAccess(cid) >= config.access then
		return true
	end

	if target == cid or not isPlayer(target) then
		return true
	end

	if (getCreatureTarget(target) > 0 and isInArray(config.targetList, getCreatureName(getCreatureTarget(target)):lower())) then
		doPlayerSendCancel(cid, "You cannot move this player.")
		return false
	end

	return true
end

 

Postado
  • Autor

@FlavioHulk data/creaturescripts/scripts/NoPushTrainers.lua:7: '}' expected (to close '{' at line 1) near 'access'
[22/10/2018 2:16:58] [Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/NoPushTrainers.lua)
[22/10/2018 2:16:58] data/creaturescripts/scripts/NoPushTrainers.lua:7: '}' expected (to close '{' at line 1) near 'access'

Meu Servidor Minecraft : Ip - Skylowcraft.minecraftbr.net:25585 = Servidor 24hrs Sem Lag , Sem Hackers (1.7.2) Servidor De Fullpvp e Survival - Vamos Colocar Minigames!.

Postado
  • Solução
local config = {
	targetList = {
		[1] = 'purching bag'
	},
	access = 3 -- Gamemaster
}

function onPush(cid, target)
	if getPlayerAccess(cid) >= config.access then
		return true
	end

	if target == cid or not isPlayer(target) then
		return true
	end

	if (getCreatureTarget(target) > 0 and isInArray(config.targetList, getCreatureName(getCreatureTarget(target)):lower())) then
		doPlayerSendCancel(cid, "You cannot move this player.")
		return false
	end

	return true
end

 

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