Ir para conteúdo
  • 0

Script Transform


Snowsz

Pergunta

tenho esse script aqui

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)



local naruto1 = 66
local naruto2 = 91
local naruto3 = 18
local naruto4 = 31
local naruto5 = 40
local naruto6 = 92
local naruto7 = 77

local sakura1 = 175
local sakura2 = 173
local sakura3 = 174
local sakura4 = 169
local sakura5 = 172
local sakura6 = 194
local sakura7 = 170

local sasuke1 = 93
local sasuke2 = 6
local sasuke3 = 5
local sasuke4 = 306
local sasuke5 = 7
local sasuke6 = 94

ext = 1000





function onCastSpell(cid, var)
if getPlayerVocation(cid) == 1 then
if getPlayerLevel(cid) >= 50 then
doPlayerSetVocation(cid, 2)
doSetCreatureOutfit(cid,66,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 50 level to first transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 2 then
if getPlayerLevel(cid) >= 120 then
doPlayerSetVocation(cid, 3)
doSetCreatureOutfit(cid,91,-1)
doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 100 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 3 then
if getPlayerLevel(cid) >= 180 then
doPlayerSetVocation(cid, 4)
doSetCreatureOutfit(cid,18,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 180 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 4 then
if getPlayerLevel(cid) >= 230 then
doPlayerSetVocation(cid, 5)
doSetCreatureOutfit(cid,31,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 230 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 5 then
if getPlayerLevel(cid) >= 290 then
doPlayerSetVocation(cid, 6)
	  doSetCreatureOutfit(cid,40,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 290 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 6 then
if getPlayerLevel(cid) >= 360 then
doPlayerSetVocation(cid, 7)
	  doSetCreatureOutfit(cid,92,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 360 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 7 then
if getPlayerLevel(cid) >= 420 then
doPlayerSetVocation(cid, 8)
	  doSetCreatureOutfit(cid,77,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 420 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 9 then
if getPlayerLevel(cid) >= 50 then
doPlayerSetVocation(cid, 10)
	  doSetCreatureOutfit(cid,93,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 50 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 10 then
if getPlayerLevel(cid) >= 120 then
doPlayerSetVocation(cid, 11)
	  doSetCreatureOutfit(cid,6,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 120 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 11 then
if getPlayerLevel(cid) >= 180 then
doPlayerSetVocation(cid, 12)
	  doSetCreatureOutfit(cid,5,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 180 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 12 then
if getPlayerLevel(cid) >= 230 then
doPlayerSetVocation(cid, 13)
	  doSetCreatureOutfit(cid,306,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 230 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 13 then
if getPlayerLevel(cid) >= 290 then
doPlayerSetVocation(cid, 14)
	  doSetCreatureOutfit(cid,7,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 290 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 14 then
if getPlayerLevel(cid) >= 360 then
doPlayerSetVocation(cid, 15)
	  doSetCreatureOutfit(cid,94,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 360 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 16 then
if getPlayerLevel(cid) >= 50 then
doPlayerSetVocation(cid, 17)
	  doSetCreatureOutfit(cid,175,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 50 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 17 then
if getPlayerLevel(cid) >= 120 then
doPlayerSetVocation(cid, 18)
	  doSetCreatureOutfit(cid,173,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 120 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 18 then
if getPlayerLevel(cid) >= 180 then
doPlayerSetVocation(cid, 19)
	  doSetCreatureOutfit(cid,174,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 180 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 19 then
if getPlayerLevel(cid) >= 230 then
doPlayerSetVocation(cid, 20)
	  doSetCreatureOutfit(cid,169,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 230 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 20 then
if getPlayerLevel(cid) >= 290 then
doPlayerSetVocation(cid, 21)
	  doSetCreatureOutfit(cid,172,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 290 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 21 then
if getPlayerLevel(cid) >= 360 then
doPlayerSetVocation(cid, 22)
	  doSetCreatureOutfit(cid,194,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 360 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

elseif getPlayerVocation(cid) == 22 then
if getPlayerLevel(cid) >= 420 then
doPlayerSetVocation(cid, 23)
	  doSetCreatureOutfit(cid,170,-1)
 doSendMagicEffect(getPlayerPosition(cid), 94)
else
doPlayerSendCancel(cid, "You need 420 level to transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

else
doPlayerSendCancel(cid, "You cannot transform.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end

 

ta dando esse erro

 

[25/09/2012 10:11:13] [Error - Spell Interface]

[25/09/2012 10:11:13] data/spells/scripts/transform.lua:onCastSpell

[25/09/2012 10:11:13] Description:

[25/09/2012 10:11:13] attempt to index a number value

[25/09/2012 10:11:13] stack traceback:

[25/09/2012 10:11:13] [C]: in function 'doSetCreatureOutfit'

[25/09/2012 10:11:13] data/spells/scripts/transform.lua:40: in function <data/spells/scripts/transform.lua:36>

 

Alguem ajeita pra mim pf ?

Editado por Snowsz
Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...