• 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 Transform script

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Hello,
im need a transform script:

TFS 0.3.1 pl2 [8.4]
SQL:
-when you say "kai chakra" change your vocation, outfit (if you logout outfit stay) and send magic effect  effect/s.

Thanks,
Erexo.

PS:
Sorry for bugs, im bad in english ^^

rep++
 
Last edited:
kai chakra.lua

Code:
function onCastSpell(cid, var)

if (getPlayerVocation(cid) == x) then  -- x = vocation before transform 
doPlayerSetVocation(cid,y) -- y = vocation after transform
doCreatureChangeOutfit(cid, {lookType=z}) -- z - looktype after transform
doSendMagicEffect(getCreaturePosition(cid), a) -- a - magic effect after transform

return true
end

u can try :)

spells.xml

Code:
<instant name="kai chakra" words="kai chakra" lvl="1" mana="0" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value=""kai chakra.lua">
	</instant>
 
LUA:
local m = -50 -- manacost, use negative.
function onSay(cid,words,param)
local n,v,voc,tmp,pos = math.random(351),math.random(1,4),getPlayerVocation(cid),getCreatureOutfit(cid),getThingPos(cid)
	while v == tonumber(voc) do
		v = math.random(1,4)
	end
	while isInArray({tmp.lookType, 75, 135, 266, 302}, v) == TRUE or v <= 1 or (v > 160 and v < 192) or v > 351 do
		n = math.random(351)
	end
	
	doCreatureAddMana(cid,m)
	doPlayerSetVocation(cid,tonumber(v))
	doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You are now a '..voc..'!')
	tmp.Looktype = n
	doCreatureChangeOufit(cid,tmp)
	for x=-1,1 do
		for y=-1,1 do
			for i = 5,15 do
				doSendMagicEffect({x=pos.x+x,y=pos.y+y,z=pos.z},i)
			end
		end
	end
        return true
end
 
Last edited:
Im dont know,
its not working, and nothing in console...

Its spell script?

@Edit
im wanna scrypt:
spell

if you have voc:1
if you have lvl: 25
if you have mana: 300
if you have soul: 5

do set outfit: 50
do set voc: 2
do add mana: -300
 
It is a talkaction, but just register and set word="" to word="kai chakra".

LUA:
local m,p,l,s = -300,300,25,5-- [1] manacost, use negative. [2] manacost, positive. (needed for formula), [3] = level, [4] soul
function onSay(cid,words,param)
local voc,tmp,pos = getPlayerVocation(cid),getCreatureOutfit(cid),getThingPos(cid)
	if getPlayerLevel(cid) >= l then
		if getCreatureMana(cid) >= (m+(p*2)) then
			if voc == 1 then
				if getPlayerSoul(cid) >= s then
					doPlayerAddSoul(cid,(s-(s*2)))
					doCreatureAddMana(cid,m)
					doPlayerSetVocation(cid,2)
					doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You are now a '..voc..'!')
					tmp.Looktype = 50
					doCreatureChangeOufit(cid,tmp)
					for x=-1,1 do
						for y=-1,1 do
							for i = 5,15 do
								doSendMagicEffect({x=pos.x+x,y=pos.y+y,z=pos.z},i)
							end
						end
					end
				else
					doPlayerSendCancel(cid,'You have too less soul.')
					doSendMagicEffect(pos,CONST_ME_POFF)
				end
			else
				doPlayerSendCancel(cid,'You\'re vocation can\'t use this spell.')
				doSendMagicEffect(pos,CONST_ME_POFF)
			end
		else
			doPlayerSendCancel(cid,'You don\'t have enough mana.')
			doSendMagicEffect(pos,CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid,'You\'re level is too low.')
		doSendMagicEffect(pos,CONST_ME_POFF)
	end
    return true
end

omg @edit -.-
EDITED!
 
Back
Top