Ir para conteúdo

Featured Replies

Postado

Fala Galera, alguem me ajuda a criar um script de um item que ao ser usado o player ganha Skills Permanente ? 

Exemplo >

Ao Usar X Item, o Player ganha 5 Leveis em Magic Level, Fist Fighting, Axe Fighting, Club Fighting, Distance Fighting e Shield ?

Montei uma base para o script mas não consegui fazer, se possível utilizar essa base.

Tentei utilizar usando a função doPlayerAddSkillTry mas não deu certo. 

TFS 0.4

function onUse(cid, item, fromPosition, itemEx, toPosition)
local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
if getPlayerStorageValue(cid, 344240) < 1 then
	if getPlayerLevel(cid) >= 400 then
	-- 

	doPlayerPopupFYI(cid, "Parabens, voce acaba de maximizar o seu personagem!")
	doSendMagicEffect(position1, 5)
	setPlayerStorageValue(cid,344240,1)
	else
	selfSay('Voce nao tem Level Suficiente !', cid)
	doSendMagicEffect(getPlayerPosition(cid), 3)
	end
else
	selfSay('Voce ja utilizou esse Max Scroll Antes !', cid)
	doSendMagicEffect(getPlayerPosition(cid), 3)
end
end

 

Resolvido por KotZletY

Ir para solução
  • Respostas 14
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @r0bert0lol  local lvl_min = 400 -- Leve mínimo para usar o script. local storage = 344240 -- Para não usar o script novamente. local skills_t = { {skill = SKILL_CLUB, count_lvl = 10}, {skill =

  • @r0bert0lol  local cfg = { level = 400, effect = 30, addLevel = { [1] = {ID_LEVEL = SKILL_AXE, quant = 1}, [2] = {ID_LEVEL = SKILL_SWORD, quant = 1}, [3] = {ID_LEVEL = SKILL_LEVEL, quant

  • local cfg = { level = 400, effect = 30, addLevel = { [1] = {id = SKILL_AXE, quant = 1}, [2] = {id = SKILL_SWORD, quant = 1}, [3] = {id = SKILL_LEVEL, quant = 1}, [4] = {id = SKILL_CLUB, qua

Postado
  • Solução

@r0bert0lol 

local lvl_min = 400 -- Leve mínimo para usar o script. 
local storage = 344240 -- Para não usar o script novamente.

local skills_t = {
{skill = SKILL_CLUB, count_lvl = 10},
{skill = SKILL_SWORD, count_lvl = 10},
{skill = SKILL_AXE, count_lvl = 10}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

	if getPlayerStorageValue(cid, storage) < 1 then
		if getPlayerLevel(cid) >= lvl_min then 
			doPlayerPopupFYI(cid, "Parabens, voce acaba de maximizar o seu personagem!")
			doSendMagicEffect(getPlayerPosition(cid), 5)
			setPlayerStorageValue(cid, storage, 1)
			for _, t in pairs(skills_t) do
				doPlayerAddSkill(cid, t.skill, t.count_lvl)
			end
		else
			selfSay('Voce nao tem Level Suficiente !', cid)
			doSendMagicEffect(getPlayerPosition(cid), 3)
		end
	else
		selfSay('Voce ja utilizou esse Max Scroll Antes !', cid)
		doSendMagicEffect(getPlayerPosition(cid), 3)
	end

	return true
end

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Postado

@r0bert0lol 

local cfg = {
	level = 400,
	effect = 30,
	addLevel = {
		[1] = {ID_LEVEL = SKILL_AXE, quant = 1},
		[2] = {ID_LEVEL = SKILL_SWORD, quant = 1},
		[3] = {ID_LEVEL = SKILL_LEVEL, quant = 1},
		[4] = {ID_LEVEL = SKILL_CLUB, quant = 1}
	},

	storage = 344240,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	local posPlayer = getPlayerPosition(cid)
	
	if not getPlayerStorageValue(cid, cfg.storage) < 1 then
		doPlayerSendTextMessage(cid, 23, "Voce ja usou o item.")
		doSendMagicEffect(posPlayer, cfg.effect)
		return false
	end

	if not getPlayerLevel(cid) >= cfg.level then
		doPlayerSendTextMessage(cid, 23, "Voce nao possui nivel.")
		doSendMagicEffect(posPlayer, cfg.effect)
		return false
	end

	for i = 1, #cfg.addLevel do
		doPlayerAddSkill(cid, cfg.addLevel[i].ID_LEVEL, cfg.addLevel[i].quant)
	end
	setPlayerStorageValue(cid, cfg.storage, 1)
	return true
end

 

Postado
  • Autor

@KotZletY 

Quanto ao Seu script ele funcionou porem não como desejava, o script não está adicionando Leveis Exatos.

Se eu colocar por exemplo, 

count_lvl = 10},

O Player ganha apenas 1 Level, e se ele já estiver com skill Alta tipo 80 + ele recebe apenas alguns % do level.

 

 

@tataboy67 

Quanto ao seu Script,  está gerando esse erro ao usar o item.

[19:20:32.703] [Error - Action Interface]
[19:20:32.703] data/actions/scripts/max skills.lua:onUse
[19:20:32.703] Description:
[19:20:32.703] data/actions/scripts/max skills.lua:18: attempt to compare boolean with number
[19:20:32.703] stack traceback:
[19:20:32.703]  data/actions/scripts/max skills.lua:18: in function <data/actions/scripts/max skills.lua:14>

 

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