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

What's wrong with this script?

Animera

* * * * *
Joined
Dec 9, 2008
Messages
2,449
Solutions
5
Reaction score
618
Location
ANIMERARPG.ONLINE
I'm using crying damson 0.3.5pl
and i put this as talkaction if i load my server it shows up no error and if i use talkaction nothing happens like you just writed a word in default and then it doesn't show any error either.

PHP:
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, -10)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 200)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, 300)

local lvl = 10 -- Requested Level of first transformation
local goku = 1 -- Vocation id
local vegeta = 2 -- Vocation id
local gohan = 3 -- Vocation id
local trunks = 4 -- Vocation id
local piccolo = 5 -- Vocation id
local ssj1goku = 6 --  Vocation id
local ssj1vegeta = 7 --  Vocation id
local ssj1gohan = 8 --  Vocation id
local ssj1trunks = 9 --  Vocation id
local supernamek = 10 --  Vocation id
local effect = 36 -- Spell effect
local say = Transform -- Say X if transform
local lowki = 100 -- X Ki transforms back to normal

function onSay(cid, param, words)
if vocation == 1 and getPlayerLevel(cid) >= lvl then doPlayerSetVocation(cid, ssj1goku)       
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1goku and getPlayerMana(cid) < lowki then 
doPlayerSetVocation(cid,goku) 
getCreatureCondition(cid, condition, -1)
end
if vocation == 2 and getPlayerLevel(cid) >= lvl then doPlayerSetVocation(cid, ssj1vegeta)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1vegeta and getPlayerMana < lowki then
doPlayerSetVocation(cid,vegeta) 
getCreatureCondition(cid, condition, -1)
end
if vocation == 3 and getPlayerLevel(cid) >= lvl then doPlayerSetVocation(cid, ssj1gohan)      
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1gohan and getPlayerMana < lowki then
doPlayerSetVocation(cid,gohan) 
getCreatureCondition(cid, condition, -1)
end
if vocation == 4 and getPlayerLevel(cid) >= lvl then doPlayerSetVocation(cid, ssj1trunks)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1trunks and getPlayerMana < lowki then
doPlayerSetVocation(cid,trunks) 
getCreatureCondition(cid, condition, -1)
end
if vocation == 5 and getPlayerLevel(cid) >= lvl then doPlayerSetVocation(cid, supernamek)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == supernamek and getPlayerMana < lowki then
doPlayerSetVocation(cid,piccolo) 
getCreatureCondition(cid, condition, -1)
end

if vocation == ssj1goku and getPlayerLevel(cid) >= lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == ssj1vegeta and getPlayerLevel(cid) >= lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == ssj1gohan and getPlayerLevel(cid) >= lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == ssj1trunks and getPlayerLevel(cid) >= lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == supernamek and getPlayerLevel(cid) >= lvl then 
doPlayerSendCancel(cid,"You reached your limit.")
end



function onDeath(cid)
if vocation == ssj1goku then doPlayerSetVocation(cid,goku) 
getCreatureCondition(cid, condition, -1)
end
if vocation == ssj1vegeta then doPlayerSetVocation(cid,vegeta)
getCreatureCondition(cid, condition, -1)
end
if vocation == ssj1gohan then doPlayerSetVocation(cid,gohan)
getCreatureCondition(cid, condition, -1)
end
if vocation == ssj1trunks then doPlayerSetVocation(cid,trunks)
getCreatureCondition(cid, condition, -1)
end
if vocation == supernamek then doPlayerSetVocation(cid,piccolo)
getCreatureCondition(cid, condition, -1)
end
end
end
 
why don't you try adding
Code:
local vocation = getPlayerVocation(cid)
Or instead of if vocation == 1 use getPlayerVocation(cid) == 1

Hope that helps i think thats what your problem might be. I would try solution 1 first

Also at the end you might want to return true and put an else to send the player a message if they can't change vocation. And maybe make it drain soul. and when you = zero soul you revert.
Also i don't think you want to put indeath in there. i think you want to put that as a creature script
 
Last edited:
Thanks a lot for you're reply but
PHP:
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, -10)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 200)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, 300)

local lvl = 10 -- Requested Level of first transformation
local goku = 1 -- Vocation id
local vegeta = 2 -- Vocation id
local gohan = 3 -- Vocation id
local trunks = 4 -- Vocation id
local piccolo = 5 -- Vocation id
local ssj1goku = 6 --  Vocation id
local ssj1vegeta = 7 --  Vocation id
local ssj1gohan = 8 --  Vocation id
local ssj1trunks = 9 --  Vocation id
local supernamek = 10 --  Vocation id
local effect = 36 -- Spell effect
local say = Transform -- Say X if transform
local lowki = 100 -- X Ki transforms back to normal
local vocation = getPlayerVocation(cid)

function onSay(cid, param, words)
if vocation == goku and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1goku)       
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1goku and getPlayerMana(cid) < lowki then 
doPlayerSetVocation(cid,goku) 
getCreatureCondition(cid, condition, -1)
end
if vocation == vegeta and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1vegeta)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1vegeta and getPlayerMana < lowki then
doPlayerSetVocation(cid,vegeta) 
getCreatureCondition(cid, condition, -1)
end
if vocation == gohan and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1gohan)      
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1gohan and getPlayerMana < lowki then
doPlayerSetVocation(cid,gohan) 
getCreatureCondition(cid, condition, -1)
end
if vocation == trunks and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1trunks)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == ssj1trunks and getPlayerMana < lowki then
doPlayerSetVocation(cid,trunks) 
getCreatureCondition(cid, condition, -1)
end
if vocation == piccolo and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, supernamek)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
end
if vocation == supernamek and getPlayerMana < lowki then
doPlayerSetVocation(cid,piccolo) 
getCreatureCondition(cid, condition, -1)
end

if vocation == ssj1goku and getPlayerLevel(cid) > lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == ssj1vegeta and getPlayerLevel(cid) > lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == ssj1gohan and getPlayerLevel(cid) > lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == ssj1trunks and getPlayerLevel(cid) > lvl then  
doPlayerSendCancel(cid,"You reached your limit.")
end
if vocation == supernamek and getPlayerLevel(cid) > lvl then 
doPlayerSendCancel(cid,"You reached your limit.")
end
return TRUE
end

this is now my script but it's still not working this error it gives now


[17/02/2010 15:32:50] Lua Script Error: [TalkAction Interface]
[17/02/2010 15:32:50] data/talkactions/scripts/concentrate.lua

[17/02/2010 15:32:51] internalGetPlayerInfo(). Player not found
 
Hahaha, about getting player info, those functions must go after declaring the function onSay... Try:

LUA:
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, -10)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 200)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, 300)

local lvl = 10 -- Requested Level of first transformation
local goku = 1 -- Vocation id
local vegeta = 2 -- Vocation id
local gohan = 3 -- Vocation id
local trunks = 4 -- Vocation id
local piccolo = 5 -- Vocation id
local ssj1goku = 6 --  Vocation id
local ssj1vegeta = 7 --  Vocation id
local ssj1gohan = 8 --  Vocation id
local ssj1trunks = 9 --  Vocation id
local supernamek = 10 --  Vocation id
local effect = 36 -- Spell effect
local say = 'Transform' -- Say X if transform
local lowki = 100 -- X Ki transforms back to normal

function onSay(cid, param, words)

local vocation = getPlayerVocation(cid)

if vocation == goku and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1goku)       
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
elseif vocation == ssj1goku and getPlayerMana(cid) < lowki then 
doPlayerSetVocation(cid,goku) 
getCreatureCondition(cid, condition, -1)
elseif vocation == vegeta and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1vegeta)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
elseif vocation == ssj1vegeta and getPlayerMana < lowki then
doPlayerSetVocation(cid,vegeta) 
getCreatureCondition(cid, condition, -1)
elseif vocation == gohan and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1gohan)      
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
elseif vocation == ssj1gohan and getPlayerMana < lowki then
doPlayerSetVocation(cid,gohan) 
getCreatureCondition(cid, condition, -1)
elseif vocation == trunks and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1trunks)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
elseif vocation == ssj1trunks and getPlayerMana < lowki then
doPlayerSetVocation(cid,trunks) 
getCreatureCondition(cid, condition, -1)
elseif vocation == piccolo and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, supernamek)     
doSendMagicEffect(getPlayerPosition(cid),effect)
doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
doAddCondition(cid, condition)
elseif vocation == supernamek and getPlayerMana < lowki then
doPlayerSetVocation(cid,piccolo) 
getCreatureCondition(cid, condition, -1)
else
doPlayerSendCancel(cid,"You reached your limit.")
end
return TRUE
end
 
Last edited:
PHP:
[17/02/2010 17:46:11] Lua Script Error: [TalkAction Interface] 
[17/02/2010 17:46:11] data/talkactions/scripts/concentrate.lua:onSay

[17/02/2010 17:46:11] data/talkactions/scripts/concentrate.lua:51: attempt to compare function with number
[17/02/2010 17:46:11] stack traceback:
[17/02/2010 17:46:11] 	data/talkactions/scripts/concentrate.lua:51: in function <data/talkactions/scripts/concentrate.lua:22>

if i restart my server nothing happens if i say the talkaction this error comes and in tibia nothing happens
 
Idk try:
LUA:
  local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, -10)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 200)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, 300)

local lvl = 10 -- Requested Level of first transformation
local goku = 1 -- Vocation id
local vegeta = 2 -- Vocation id
local gohan = 3 -- Vocation id
local trunks = 4 -- Vocation id
local piccolo = 5 -- Vocation id
local ssj1goku = 6 --  Vocation id
local ssj1vegeta = 7 --  Vocation id
local ssj1gohan = 8 --  Vocation id
local ssj1trunks = 9 --  Vocation id
local supernamek = 10 --  Vocation id
local effect = 36 -- Spell effect
local say = 'Transform' -- Say X if transform
local lowki = 100 -- X Ki transforms back to normal

function onSay(cid, param, words)

local vocation = getPlayerVocation(cid)

if vocation == goku and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1goku)      
	doSendMagicEffect(getPlayerPosition(cid),effect)
	doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
	doAddCondition(cid, condition)
elseif vocation == ssj1goku and getPlayerMana(cid) < lowki then
	doPlayerSetVocation(cid,goku)
	getCreatureCondition(cid, condition, -1)
elseif vocation == vegeta and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1vegeta)    
	doSendMagicEffect(getPlayerPosition(cid),effect)
	doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
	doAddCondition(cid, condition)
elseif vocation == ssj1vegeta and getPlayerMana < lowki then
	doPlayerSetVocation(cid,vegeta)
	getCreatureCondition(cid, condition, -1)
elseif vocation == gohan and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1gohan)      
	doSendMagicEffect(getPlayerPosition(cid),effect)
	doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
	doAddCondition(cid, condition)
elseif vocation == ssj1gohan and getPlayerMana < lowki then
	doPlayerSetVocation(cid,gohan)
	getCreatureCondition(cid, condition, -1)
elseif vocation == trunks and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1trunks)    
	doSendMagicEffect(getPlayerPosition(cid),effect)
	doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
	doAddCondition(cid, condition)
elseif vocation == ssj1trunks and getPlayerMana < lowki then
	doPlayerSetVocation(cid,trunks)
	getCreatureCondition(cid, condition, -1)
elseif vocation == piccolo and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, supernamek)    
	doSendMagicEffect(getPlayerPosition(cid),effect)
	doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
	doAddCondition(cid, condition)
elseif vocation == supernamek and getPlayerMana < lowki then
	doPlayerSetVocation(cid,piccolo)
	getCreatureCondition(cid, condition, -1)
else
	doPlayerSendCancel(cid,"You reached your limit.")
end

return TRUE
end
 
same problem other error
PHP:
[17/02/2010 18:11:11] Lua Script Error: [TalkAction Interface] 
[17/02/2010 18:11:11] data/talkactions/scripts/concentrate.lua:onSay

[17/02/2010 18:11:11] data/talkactions/scripts/concentrate.lua:51: attempt to compare function with number
[17/02/2010 18:11:11] stack traceback:
[17/02/2010 18:11:11] 	data/talkactions/scripts/concentrate.lua:51: in function <data/talkactions/scripts/concentrate.lua:22>
 
Awesome it works i could kiss you all :)
but i don't lose mana every second
and if mana is below 100 i won't turn back
i also get no mana/hp
 
Last edited:
hmm yeah, I know, don't know how to make this part working(globalevent to decrease mana+onStatChange for transform back when mana goes below 100 because of anything-spell usage, manadrain, manashield like thingy probably)
 
PHP:
local combat = createCombatObject()

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, -10)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 200)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, 300)
setCombatCondition(combat, condition)
local lvl = 10 -- Requested Level of first transformation
local goku = 1 -- Vocation id
local vegeta = 2 -- Vocation id
local gohan = 3 -- Vocation id
local trunks = 4 -- Vocation id
local piccolo = 5 -- Vocation id
local ssj1goku = 6 --  Vocation id
local ssj1vegeta = 7 --  Vocation id
local ssj1gohan = 8 --  Vocation id
local ssj1trunks = 9 --  Vocation id
local supernamek = 10 --  Vocation id
local asgoku = 11 --  Vocation id
local asvegeta = 12 --  Vocation id
local asgohan = 13 --  Vocation id
local astrunks = 14 --  Vocation id
local superrnamek = 15 --  Vocation id
local ssj2goku = 16 --  Vocation id
local ssj2vegeta = 17 --  Vocation id
local ssj2gohan = 18 --  Vocation id
local asstrunks = 19 --  Vocation id
local superrrnamek = 20 --  Vocation id
local effect = 36 -- Spell effect
local say = 'Transform' -- Say X if transform
local lowki = 100 -- X Ki transforms back to normal
local vocation = getPlayerVocation(cid)
local lvl2 = 100 -- Requested Level of first transformation
local effect2 = 41 -- Spell effect

function onSay(cid, param, words)


if vocation == goku and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1goku)      
        doSendMagicEffect(getPlayerPosition(cid),effect)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj1goku and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,goku)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == vegeta and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1vegeta)    
        doSendMagicEffect(getPlayerPosition(cid),effect)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj1vegeta and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,vegeta)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == gohan and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1gohan)      
        doSendMagicEffect(getPlayerPosition(cid),effect)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj1gohan and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,gohan)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == trunks and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, ssj1trunks)    
        doSendMagicEffect(getPlayerPosition(cid),effect)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj1trunks and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,trunks)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == piccolo and getPlayerLevel(cid) > lvl then doPlayerSetVocation(cid, supernamek)    
        doSendMagicEffect(getPlayerPosition(cid),effect)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == supernamek and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,piccolo)
        getCreatureCondition(cid, condition, -1)
		return TRUE
end		
function onSay(cid, param, words)
if vocation == ssj1goku and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, asgoku)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == asgoku and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,goku)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == ssj1vegeta and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, asvegeta)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == asvegeta and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,vegeta)
        getCreatureCondition(cid, condition, -1)		
		
		
elseif vocation == ssj1gohan and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, asgohan)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == asgohan and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,gohan)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == ssj1trunks and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, astrunks)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == astrunks and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,trunks)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == supernamek and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, superrnamek)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == superrnamek and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,piccolo)
        getCreatureCondition(cid, condition, -1)		
return TRUE
end

function onSay(cid, param, words)
if vocation == asgoku and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, ssj2goku)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj2goku and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,goku)
        getCreatureCondition(cid, condition, -1)
		
		
elseif vocation == asvegeta and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, ssj2vegeta)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj2vegeta and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,vegeta)
        getCreatureCondition(cid, condition, -1)		
		
		
elseif vocation == asgohan and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, ssj2gohan)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == ssj2gohan and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,gohan)
        getCreatureCondition(cid, condition, -1)	

		
elseif vocation == astrunks and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, asstrunks)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == asstrunks and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,trunks)
        getCreatureCondition(cid, condition, -1)	

		
elseif vocation == superrnamek and getPlayerLevel(cid) > lvl2 then doPlayerSetVocation(cid, superrrnamek)      
        doSendMagicEffect(getPlayerPosition(cid),effect2)
        doCreatureSay(cid, say, TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
elseif vocation == superrnamek and getPlayerMana(cid) < lowki then
        doPlayerSetVocation(cid,piccolo)
        getCreatureCondition(cid, condition, -1)			
else		
        doPlayerSendCancel(cid,"You reached your limit.")
end
return TRUE
end
end

error:
PHP:
[18/02/2010 00:03:09] Lua Script Error: [TalkAction Interface] 
[18/02/2010 00:03:09] data/talkactions/scripts/concentrate.lua

[18/02/2010 00:03:09] internalGetPlayerInfo(). Player not found
 
Holy fuck man, just use this:
LUA:
function onSay(cid, words, param)
local config = {price = 20000, level = 20}
local vocations = {
    {next_vocation = 5}, -- 1
    {next_vocation = 6}, -- 2
    {next_vocation = 7}, -- 3
    {next_vocation = 8}  -- 4
}
local player_position = getPlayerPosition(cid)
local player_vocation = getPlayerVocation(cid)
    if getPlayerLevel(cid) >= config.level and doPlayerRemoveMoney(cid, config.price) == true then
        if vocations[player_vocation] ~= nil then
            doPlayerSetVocation(cid, vocations[player_vocation].next_vocation)
            doSendMagicEffect(player_position, 41)
        else
            doPlayerSendCancel(cid, "You are already promoted!")
            doSendMagicEffect(player_position, 2)
        end
    else
        doPlayerSendCancel(cid, "You need level ".. config.level .." and ".. config.price .." gold pieces to buy promotion!")
        doSendMagicEffect(player_position, 2)
    end
return true
end

Works fine...
 
Back
Top