• 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!

Transform Script.

Saper1995

Technologic
Joined
Jul 11, 2009
Messages
104
Reaction score
3
Location
Poland
Hello everyone. I have a problem with this script, it is that does not work .. I am confident that this forum will be the person who could help me improve this spell. And if anyone would be able to add a line that makes that life and mana back to previous settings before using the spell would be very grateful! For help, give reputation. Thank you and best regards!
Sorry for the translation if is bad.:p

function onCastSpell(cid, var)

if getPlayerVocation(cid) == 1 then
if getPlayerLevel(cid) >= 50 then
doPlayerSetVocation (cid, 6)
doSendMagicEffect (getCreaturePosition (cid), 10)
doCreatureChangeOutfit (cid, {lookType = 244})
local maxHp = getCreatureMaxHealth (cid)
local newHp = (3000 + maxHp)
setCreatureMaxHealth (cid, newHp)
local maxMp = getCreatureMaxMana (cid)
local newMp = (3000 + maxMp)
setCreatureMaxMana (cid, newMp)
else
end

end
end
 
Lua:
function onCastSpell(cid, var)
	local f = getPlayerVocation(cid) == 1
	doPlayerSetVocation(cid, f and 6 or 1)
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	if f then
		doSetCreatureOutfit(cid, {lookType = 244}, -1)
	else
		doRemoveCondition(cid, CONDITION_OUTFIT)
	end
	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + (f and 3000 or -3000))
	setCreatureMaxMana(cid, getCreatureMaxMana(cid) + (f and 3000 or -3000))
	return true
end
 
Does not work that way I had in mind. It can be done so that, for undoing the spell did not have to enter the second time this spell only to relog stopped working and went back to their original settings??.
 
You must add some lines in login.lua and if you got revert in talkactions or spell, idk where you script it. Just paste the part of script from revert (removing added mana & hp) and put it in login.lua with "ifGetPlayerVocation" = ex. Vegeta than remove the mana, what you added on transform. If you have ex. Vegeta ssj you got ex. 5k mana (adding) if you have vegeta ssj 2 you got ex. 5k + 5k mana than you must remove 10k mana on vocation vegeta ssj2.
 
Back
Top