Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

bom gostaria de um script para um book que da as 5 blessing ao clikar nele e nao some mas so pode ser usado por players premium.

OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!

  • Respostas 8
  • Visualizações 653
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • luanluciano93
    luanluciano93

    -- <action itemid="9999" script="teste.lua"/> function onUse(cid, item, fromPosition, itemEx, toPosition) local PLAYER = Player(cid) local COST = getBlessingsCost(getPlayerLevel(cid)) loca

  • luanluciano93
    luanluciano93

    Tenta esse ...  function onUse(cid, item, frompos, itemEx, topos) local p = Player(cid) local COST = 10000 -- valor da bless if p:getPremiumDays() >= 1 then if(not(isPlayerPzLocked(cid

Postado
-- <action itemid="9999" script="teste.lua"/>

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	local PLAYER = Player(cid)
	local COST = getBlessingsCost(getPlayerLevel(cid))
	local BOOK_ID = 9999
	
	if item.itemid == BOOK_ID then	
		if(not(isPlayerPzLocked(cid))) then
			
			if(PLAYER:hasBlessing(1) and PLAYER:hasBlessing(2) and PLAYER:hasBlessing(3) and PLAYER:hasBlessing(4) and PLAYER:hasBlessing(5)) then
				PLAYER:sendCancelMessage("You have already been blessed by the gods.")
				return false
			end
			
			if(PLAYER:removeMoney(COST)) then
				for b = 1,5 do
					PLAYER:addBlessing(b)
				end	
				PLAYER:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
				PLAYER:sendTextMessage(MESSAGE_INFO_DESCR, "You have been blessed by the 5 gods!")
				Item(item.uid):remove(1)
			else
				PLAYER:sendCancelMessage("You need "..COST.." gold coins to buy all 5 bless.")
			end
		else
			PLAYER:sendCancelMessage("You can't buy bless, when you are in a battle.")
		end
	else
		return false
	end

	return true
end
Postado
function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	local PLAYER = Player(cid)
	local COST = 10000 -- valor da bless
	local BOOK_ID = 9999 -- id do item (book)
	
	if item.itemid == BOOK_ID then	
		
		if PLAYER:getPremiumDays() >= 1 then		
			if(not(isPlayerPzLocked(cid))) then			
				if(PLAYER:hasBlessing(1) and PLAYER:hasBlessing(2) and PLAYER:hasBlessing(3) and PLAYER:hasBlessing(4) and PLAYER:hasBlessing(5)) then
					PLAYER:sendCancelMessage("You have already been blessed by the gods.")
					return false
				end
				
				if(PLAYER:removeMoney(COST)) then
					for b = 1,5 do
						PLAYER:addBlessing(b)
					end	
					PLAYER:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
					PLAYER:sendTextMessage(MESSAGE_INFO_DESCR, "You have been blessed by the 5 gods!")
					Item(item.uid):remove(1)
				else
					PLAYER:sendCancelMessage("You need "..COST.." gold coins to buy all 5 bless.")
				end
			else
				PLAYER:sendCancelMessage("You can't buy bless, when you are in a battle.")
			end
		else
			PLAYER:sendCancelMessage("You no have premium account.")
		end
	else
		return false
	end

	return true
end
Postado
  • Autor

cara ta quase perfeito agora gostaria que quando o cara clika-se no item aparece-se vc nao possui premium[ se ele nao tiver premium] ou Voce ja possui os 5 blessing [ se vc ja tiver clikado no livro]

OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!

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.7k

Informação Importante

Confirmação de Termo