• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Can't find mistake in transform script [help please!]

walukasz

New Member
Joined
Aug 15, 2009
Messages
36
Reaction score
1
Hi

Scripter made a script for transform
example:
i have voc "naruto"
i say !transform my outfit changes to naruto with one tail my strengh grows up, also speed
i say !trasnform again and my outfit again changes to three-tailed naruto and my speed ang skills again grows.
if i log on sasuke situation should be the same but other outfits

script is here:

Code:
function onSay(cid, words, param, channel)

	local pierwszy = {
		naruto = { lookType = 343, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		sasuke = { lookType = 345, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		sakura = { lookType = 347, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		rocklee = { lookType = 349, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		neji = { lookType = 351, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		gaara = { lookType = 354, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		kankurou = { lookType = 356, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		kiba = { lookType = 353, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 }
	}
	local drugi = {
		narut = { lookType = 344, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		sasek = { lookType = 346, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		sakurka = { lookType = 348, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		lee = { lookType = 350, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		nedzi = { lookType = 352, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		gara = { lookType = 355, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		kank = { lookType = 334, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 },
		kibaa = { lookType = 332, lookHead = 1, lookBody = 1, lookLegs = 1, lookFeet = 1, lookAddons = 0 }
	}
	local config = {
		efekt = 67, -- numer efektu wirujacej chakry
		pierwszymana = 6, -- ile many ma brac pierwszy trans
		drugimana = 20, -- ile ma brac drugi trans
		pierwszycoile = 1, -- co ile sekund ma brac mane w pierwszym transie
		drugicoile = 1.2, -- co ile sekund ma brac mnane w drugim transie
		pierwszylvl = 50, -- wymaganay poziom na 1 trans
		drugilvl = 100 -- wymaganay poziom na 2 trans
	}
	local maxMana = getCreatureMaxMana(cid)
	local mana = getCreatureMana(cid)
	local szybkosc = getCreatureSpeed(cid)
	local pozycja = getPlayerName(cid)
	local poziom = getPlayerLevel(cid)

function pierwszyTrans(cid)
	if(poziom >= config.pierwszylvl) then
		if(mana >= (maxMana / 3)) then
			doCreatureAddMana(cid, -config.pierwszymana)
			doChangeSpeed(cid, (szybkosc + 20)) -- (delta) nie jestem pewien jak to dokladnie dziala
			addEvent(pierwszyTrans, (config.pierwszycoile * 1000))
		else
			stopEvent(pierwszyTrans)
			doChangeSpeed(cid, (szybkosc - 20))
		end
	end
return TRUE
end

function drugiTrans(cid)
	if(poziom >= config.drugilvl) then
		if(mana >= (maxMana / 2)) then
			doCreatureAddMana(cid, -config.drugimana)
			doChangeSpeed(cid, (szybkosc + 40))
			addEvent(drugiTrans, (config.drugicoile * 1000))
		else
			stopEvent(drugiTrans)
			doChangeSpeed(cid, (szybkosc - 40))
		end
	end
return TRUE
end

function pierwszyChakra(cid)
	if(poziom >= config.pierwszylvl) then
		if(mana >= (maxMana / 3)) then
			doCreatureAddMana(cid, -config.pierwszymana)
			doChangeSpeed(cid, (szybkosc + 20)) -- (delta) nie jestem pewien jak to dokladnie dziala
			addEvent(pierwszyTrans, (config.pierwszycoile * 1000))
		else
			stopEvent(pierwszyChakra)
			doChangeSpeed(cid, (szybkosc - 20))
		end
	end
return TRUE
end
--
function drugiChakra(cid)
	if(poziom >= config.drugilvl) then
		if(mana >= (maxMana / 2)) then
			doCreatureAddMana(cid, -config.drugimana)
			doSendMagicEffect(pozycja, config.efekt)
			doChangeSpeed(cid, (szybkosc + 40))
			addEvent(drugiChakra, (config.drugicoile * 1000))
		else
			stopEvent(drugiChakra)
			doChangeSpeed(cid, (szybkosc - 40))
		end
	end
return TRUE
end

	if getPlayerVocation(cid, 1) then
		doSetCreatureOutfit(cid, pierwszy.naruto, -1)
		addEvent(pierwszyTrans, 1, cid)
		doPlayerSetVocation(cid, 2)
	elseif getPlayerVocation(cid, 2) then
		doSetCreatureOutfit(cid, drugi.narut, -1)
		addEvent(drugiTrans, 1, cid)
		doPlayerSetVocation(cid, 3)
	elseif getPlayerVocation(cid, 6) then
		doSetCreatureOutfit(cid, pierwszy.sasuke, -1)
		addEvent(pierwszyTrans, 1, cid)
		doPlayerSetVocation(cid, 7)
	elseif getPlayerVocation(cid, 7) then
		doSetCreatureOutfit(cid, drugi.sasek, -1)
		addEvent(drugiTrans, 1, cid)
		doPlayerSetVocation(cid, 8)
	elseif getPlayerVocation(cid, 11) then
		doSetCreatureOutfit(cid, pierwszy.sakura, -1)
		addEvent(pierwszyChakra, 1, cid)
		doPlayerSetVocation(cid, 12)
	elseif getPlayerVocation(cid, 12) then
		doSetCreatureOutfit(cid, drugi.sakurka, -1)
		addEvent(drugiTrans, 1, cid)
		doPlayerSetVocation(cid, 13)
	elseif getPlayerVocation(cid, 16) then
		doSetCreatureOutfit(cid, pierwszy.rocklee, -1)
		addEvent(pierwszyChakra, 1, cid)
		doPlayerSetVocation(cid, 17)
	elseif getPlayerVocation(cid, 17) then
		doSetCreatureOutfit(cid, drugi.lee, -1)
		addEvent(drugiTrans, 1, cid)
		doPlayerSetVocation(cid, 18)
	elseif getPlayerVocation(cid, 21) then
		doSetCreatureOutfit(cid, pierwszy.neji, -1)
		addEvent(pierwszyTrans, 1, cid)
		doPlayerSetVocation(cid, 22)
	elseif getPlayerVocation(cid, 22) then
		doSetCreatureOutfit(cid, drugi.nedzi, -1)
		addEvent(drugiChakra, 1, cid)
		doPlayerSetVocation(cid, 23)
	elseif getPlayerVocation(cid, 31) then
		doSetCreatureOutfit(cid, pierwszy.gaara, -1)
		addEvent(pierwszyTrans, 1, cid)
		doPlayerSetVocation(cid, 32)
	elseif getPlayerVocation(cid, 32) then
		doSetCreatureOutfit(cid, drugi.gara, -1)
		addEvent(drugiTrans, 1, cid)
		doPlayerSetVocation(cid, 33)
	elseif getPlayerVocation(cid, 36) then
		doSetCreatureOutfit(cid, pierwszy.kankurou, -1)
		addEvent(pierwszyTrans, 1, cid)
		doPlayerSetVocation(cid, 37)
	elseif getPlayerVocation(cid, 37) then
		doSetCreatureOutfit(cid, drugi.kank, -1)
		addEvent(drugiChakra, 1, cid)
		doPlayerSetVocation(cid, 38)
	elseif getPlayerVocation(cid, 26) then
		doSetCreatureOutfit(cid, pierwszy.kiba, -1)
		addEvent(pierwszyTrans, 1, cid)
		doPlayerSetVocation(cid, 27)
	elseif getPlayerVocation(cid, 27) then
		doSetCreatureOutfit(cid, drugi.kibaa, -1)
		addEvent(drugiChakra, 1, cid)
		doPlayerSetVocation(cid, 28)
	end
return TRUE
end

or here
Code:
http://wklej.to/Jaq9

And the problem is if I log on any vocation (naruto, sasuke itd.)
and say !transform my outfit changes to one-tailed naruto (even if i am on sasuke) and if i say !transform again nothing happens.

looks like script stops here:
Code:
doPlayerSetVocation(cid, 2)

I don't know where is the mistake

what's wrong here?

Please help
 
Last edited:
change to polish board or rescript to the english.. no1 can help if it is on pl soo Re*arded to understand it ?
 
@up
I lol'd. You are noob or what? script is in english.. polish words you have only for locals...
like:
Code:
	local maxMana = getCreatureMaxMana(cid)
	local mana = getCreatureMana(cid)
	local szybkosc = getCreatureSpeed(cid)
	local pozycja = getPlayerName(cid)
	local poziom = getPlayerLevel(cid)
 
Back
Top