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

edit talkactions x.y transform

Daniel Braga

New Member
Joined
Mar 17, 2018
Messages
53
Reaction score
1
Speak my brothers, I would like some help from the community.
On my server I have the talkactions of character transformations, I would like to be able to change the X.Y position of the effect that comes out of each player when they say ''' transform'''
Is this possible? does anyone have any idea about this? can anyone help me?

I'll leave the script with just 1 transformation so it doesn't get too long.


local config = {
--[vocation id] = { level, nova voc, looktype, efeito}
-- Goku
[1] = { 50, 2, 4, 118},
[2] = { 100, 3, 5, 114},
[3] = { 150, 4, 7, 114},
[4] = { 200, 5, 9, 467},
[6] = { 50, 7, 11, 490},
[7] = { 100, 8, 12, 490},
[8] = { 150, 9, 13, 490},
[9] = { 200, 10, 14, 125},
[10] = { 400, 11, 817, 628},
[11] = { 600, 12, 819, 662}
}
function onSay(cid, words, param, channel)
local voc = config[getPlayerVocation(cid)]
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
doCreatureSay(cid, "Transformar", 19)
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doSendMagicEffect(getCreaturePosition(cid), voc[4])
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
end
else
doPlayerSendCancel(cid, "Nao é possível se transformar.")
end
return true
end

remembering that I only want to be able to change the position x or y that the effect comes out with each transformation.
 
Solution
Lua:
local config = {
--[vocation id] = { level, nova voc, looktype, efeito, position x, y}
-- Goku
[1] = { 50, 2, 4, 118, x = -1, y = -1},
[2] = { 100, 3, 5, 114},
[3] = { 150, 4, 7, 114},
[4] = { 200, 5, 9, 467},
[6] = { 50, 7, 11, 490},
[7] = { 100, 8, 12, 490},
[8] = { 150, 9, 13, 490},
[9] = { 200, 10, 14, 125},
[10] = { 400, 11, 817, 628},
[11] = { 600, 12, 819, 662}
}
function onSay(cid, words, param, channel)

   local voc = config[getPlayerVocation(cid)]
   if voc then
      local level = getPlayerLevel(cid)
      if level >= voc[1] then
         doPlayerSetVocation(cid, voc[2])
         doCreatureSay(cid, "Transformar", 19)
         local outfit = {lookType = voc[3]}
         doCreatureChangeOutfit(cid, outfit)
         local...
Lua:
local config = {
--[vocation id] = { level, nova voc, looktype, efeito, position x, y}
-- Goku
[1] = { 50, 2, 4, 118, x = -1, y = -1},
[2] = { 100, 3, 5, 114},
[3] = { 150, 4, 7, 114},
[4] = { 200, 5, 9, 467},
[6] = { 50, 7, 11, 490},
[7] = { 100, 8, 12, 490},
[8] = { 150, 9, 13, 490},
[9] = { 200, 10, 14, 125},
[10] = { 400, 11, 817, 628},
[11] = { 600, 12, 819, 662}
}
function onSay(cid, words, param, channel)

   local voc = config[getPlayerVocation(cid)]
   if voc then
      local level = getPlayerLevel(cid)
      if level >= voc[1] then
         doPlayerSetVocation(cid, voc[2])
         doCreatureSay(cid, "Transformar", 19)
         local outfit = {lookType = voc[3]}
         doCreatureChangeOutfit(cid, outfit)
         local pos = getCreaturePosition(cid)
         local x = pos.x
         local y = pos.y
         local z = pos.z
         if voc.x then
            x = x + voc.x
         end
         if voc.y then
            y = y + voc.y
         end
        doSendMagicEffect({ x = x, y = y, z = z }, voc[4])
      else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
      end
   else
        doPlayerSendCancel(cid, "Nao é possível se transformar.")
   end
 
return true
end
Now you can move effects position in config.
 
Last edited:
Solution
[CÓDIGO=lua]
configuração local = {
--[vocation id] = { level, nova voc, looktype, efeito, position x, y}
-- Goku
[1] = { 50, 2, 4, 118, x = -1, y = -1},
[2] = { 100, 3, 5, 114},
[3] = { 150, 4, 7, 114},
[4] = { 200, 5, 9, 467},
[6] = { 50, 7, 11, 490},
[7] = { 100, 8, 12, 490},
[8] = { 150, 9, 13, 490},
[9] = { 200, 10, 14, 125},
[10] = { 400, 11, 817, 628},
[11] = { 600, 12, 819, 662}
}
função onSay(cid, palavras, param, canal)

local voc = config[getPlayerVocation(cid)]
se vc então
nível local = getPlayerLevel(cid)
se nível >= voc[1] então
doPlayerSetVocation(cid, voc[2])
doCreatureSay(cid, "Transformar", 19)
roupa local = {lookType = voc[3]}
doCreatureChangeOutfit(cid, roupa)
local pos = getCreaturePosition(cid)
local x = pos.x
local y = pos.y
local z = pos.z
se vc.x então
x = x + voc.x
fim
se vc.y então
y = y + voc.y
fim
doSendMagicEffect({ x = x, y = y, z = z }, voc[4])
senão
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar sem nível " .. voc[1] .. " para transformar.")
fim
senão
doPlayerSendCancel(cid, "Não é possível se transformar.")
fim

retornar verdadeiro
fim
[/CÓDIGO]
Agora você pode mover a posição dos efeitos na configuração.

thank you so much for taking your time and helping me, i really appreciate it
 
Back
Top