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

Two talkaction's

jubix

New Member
Joined
Aug 7, 2007
Messages
21
Reaction score
0
HI. Do is a chance to two vocations have talkaction with the same word "transform" but with two different scripts?
 
<talkaction words="transform" script="gokussj.lua" />
<talkaction words="transform" script="gokussj2.lua" />
That not working, only first transform.
And script is:
-- Transformation System

local configuration =
{
playerVocation = {1},
playerNewVocation = 2,
playerNewLookType = 3,
playerLevel = 10,
manaCost = 100,
soulCost = 0,
timeActive = 60
}

local VOCATION_STORAGE = 10000
local outfit = {lookType = configuration.playerNewLookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}

function onSay(cid, words, param)
if(isInArray(configuration.playerVocation, getPlayerVocation(cid)) == TRUE) then
if(getPlayerLevel(cid) >= configuration.playerLevel) then
if(getPlayerMana(cid) >= configuration.manaCost) then
if(getPlayerSoul(cid) >= configuration.soulCost) then
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
doPlayerSetVocation(cid, configuration.playerNewVocation)
doPlayerAddMana(cid, - configuration.manaCost)
doPlayerAddSoul(cid, - configuration.soulCost)
doSetCreatureOutfit(cid, outfit, configuration.timeActive * 1000)
addEvent(transformBack, configuration.timeActive * 1000, cid)
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required soul points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required mana points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required level.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.")
end
end

function transformBack(cid)
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
end
 
It has to be in one file and in it add check:
Code:
if getPlayerVocation(cid) == x then
    -- transform for x voc
elseif getPlayerVocation(cid) == x1 then
    -- transfotm for x1 voc
end
 
Back
Top