Ir para conteúdo

Featured Replies

  • Respostas 5
  • Visualizações 661
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = {     item = 2193, -- itemId     itemCount = 1, -- quantos items     soul = 1, -- quanto de soul vai ganhar     message = 'You need one ankh to gain a soul.', } function

Posted Images

Postado

local config = {
    item = 2193, -- itemId
    itemCount = 1, -- quantos items
    soul = 1, -- quanto de soul vai ganhar
    message = 'You need one ankh to gain a soul.',
}

function onSay(cid, words, param)
    if not getPlayerItemCount(cid, config.item, config.itemCount) then
        doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message))
        return true
    end

    doPlayerRemoveItem(cid, config.item)
    doPlayerAddSoul(cid, config.soul)
    doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul))
    return false
end

 

 

Creditos: Vankk

Postado
  • Autor
33 minutos atrás, Pepeco disse:

local config = {
    item = 2193, -- itemId
    itemCount = 1, -- quantos items
    soul = 1, -- quanto de soul vai ganhar
    message = 'You need one ankh to gain a soul.',
}

function onSay(cid, words, param)
    if not getPlayerItemCount(cid, config.item, config.itemCount) then
        doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message))
        return true
    end

    doPlayerRemoveItem(cid, config.item)
    doPlayerAddSoul(cid, config.soul)
    doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul))
    return false
end

 

 

Creditos: Vankk

Nice, mas nesse caso só funciona como talkaction, certo? Seria possivel voce colocar pra gastar 1% da mana e 1 segundo de exhaust pra usar, pra ficar parecido com uma spell mesmo ?

@EDIT

Esqueci de dizer, eu to usando TFS 0.4 8.60

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

Postado

@yolocaust

 

local config = {
item = 2193, -- itemId
itemCount = 1, -- quantos items
soul = 1, -- quanto de soul vai ganhar
message = 'You need one ankh to gain a soul.',
storage = 165786,
exhaust = 1, -- tempo em segundos.
}

local percent = getPlayerMana(cid)/100

function onSay(cid, words, param)
	if not getPlayerItemCount(cid, config.item, config.itemCount) then
		doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message))
	return true
	end
	
	if getPlayerStorageValue (cid, config.storage) < os.time() then
		doPlayerRemoveItem(cid, config.item)
		doPlayerAddSoul(cid, config.soul)
		doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul))
		setPlayerStorageValue (cid, config.storage, config.exhaust + os.time())
		doPlayerAddMana (cid, -percent)
	else
		doPlayerSendCancel (cid, "You're exhausted.")
	end
return false
end

 

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

Não dou suporte via PM, crie um tópico caso tenha dúvidas.

Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.

Postado
  • Autor
1 hora atrás, Talesigorvr disse:

@yolocaust

 


local config = {
item = 2193, -- itemId
itemCount = 1, -- quantos items
soul = 1, -- quanto de soul vai ganhar
message = 'You need one ankh to gain a soul.',
storage = 165786,
exhaust = 1, -- tempo em segundos.
}

local percent = getPlayerMana(cid)/100

function onSay(cid, words, param)
	if not getPlayerItemCount(cid, config.item, config.itemCount) then
		doPlayerBroadcastMessage(cid, 21, string.format('%s', config.message))
	return true
	end
	
	if getPlayerStorageValue (cid, config.storage) < os.time() then
		doPlayerRemoveItem(cid, config.item)
		doPlayerAddSoul(cid, config.soul)
		doPlayerBroadcastMessage(cid, 21, string.format('You have gained %d soul points', config.soul))
		setPlayerStorageValue (cid, config.storage, config.exhaust + os.time())
		doPlayerAddMana (cid, -percent)
	else
		doPlayerSendCancel (cid, "You're exhausted.")
	end
return false
end

 

@Talesigorvr

Nao funcionou e deu erro na distro:

496ad4c23e17495ca58e6013d5c36ab9.png

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