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

Talkaction Script "melt"

Na Amigo

The crazy girl
Joined
Jun 5, 2017
Messages
254
Solutions
3
Reaction score
18
Location
Egypt
i've this script but it's only working at 8.1 but i don't know why it's not working at tfs 0.3.7_svn the idea of this script it's melting the frozen wall with action id, of the wall and if you pass from it the wall appear again
Code:
<talkaction words="melt" script="melt.lua" />
Code:
function onSay(cid, words, param)
apos = getPlayerPosition(cid)
ppos = {x=apos.x, y=apos.y-1, z=apos.z, stackpos=1}
tpos = getThingfromPos(ppos)

if tpos.actionid == 2765 then
doSendMagicEffect(ppos, 5)
doPlayerSay(cid, "EXORI FLAM", 25)
doPlayerSendTextMessage(cid, 25, "Success")

doRemoveItem(tpos.uid, 1)
else
doSendMagicEffect(apos, 15)
doPlayerSendTextMessage(cid, 25, "Failed.")
return true
end
end
 
Last edited:
Solution
i've do but still i take a bug and nothing appear at the console
:s

try this then.
Make sure you install -> save file -> restart server
Lua:
function onSay(cid, words, param)
   apos = getPlayerPosition(cid)
   for i = 1, 255 do
       print("" .. i .. "" .. i .. "")
       ppos = {x = apos.x, y = apos.y - 1, z = apos.z, stackpos = i}
       tpos = getThingfromPos(ppos)
       print(tpos.uid)
       if tpos.uid > 0 then
           print(tpos.aid)
           if tpos.aid == 2765 then
               doSendMagicEffect(ppos, 5)
               doPlayerSay(cid, "EXORI FLAM", 25)
               doPlayerSendTextMessage(cid, 25, "Success")
               doRemoveItem(tpos.uid, 1)
               return true
           end
       else...
i've this script but it's only working at 8.1 but i don't know why it's not working at tfs 0.3.7_svn the idea of this script it's melting the frozen wall with action id, of the wall and if you pass from it the wall appear again
Code:
<talkaction words="melt" script="melt.lua" />
Code:
function onSay(cid, words, param)
apos = getPlayerPosition(cid)
ppos = {x=apos.x, y=apos.y-1, z=apos.z, stackpos=1}
tpos = getThingfromPos(ppos)

if tpos.actionid == 2765 then
doSendMagicEffect(ppos, 5)
doPlayerSay(cid, "EXORI FLAM", 25)
doPlayerSendTextMessage(cid, 25, "Success")

doRemoveItem(tpos.uid, 1)
else
doSendMagicEffect(apos, 15)
doPlayerSendTextMessage(cid, 25, "Failed.")
return true
end
end
try changing
Lua:
pos = getThingfromPos(ppos)
to
Lua:
pos = getThingfromPos(ppos).uid

If your still having troubles try changing
Lua:
if tpos.actionid == 2765 then
to
Lua:
if tpos.aid == 2765 then
Although I don't think it's a required change.
 
try changing
Lua:
pos = getThingfromPos(ppos)
to
Lua:
pos = getThingfromPos(ppos).uid

If your still having troubles try changing
Lua:
if tpos.actionid == 2765 then
to
Lua:
if tpos.aid == 2765 then
Although I don't think it's a required change.
worked but it give bug and tibia close and the wall didn't back
 
worked but it give bug and tibia close and the wall didn't back
which part worked? xP

oh, and also this
Lua:
doRemoveItem(tpos.uid, 1)
to this
Lua:
doRemoveItem(tpos, 1)

Maybe that's the other issue.
 
ugh, we went over this before.
"bug" doesn't tell me much.

do some prints.
Lua:
function onSay(cid, words, param)
   apos = getPlayerPosition(cid)
   ppos = {x=apos.x, y=apos.y-1, z=apos.z, stackpos=1}
   tpos = getThingfromPos(ppos)
   
   print(tpos.uid)
   print(tpos.aid)
   if tpos.aid == 2765 then
       doSendMagicEffect(ppos, 5)
       doPlayerSay(cid, "EXORI FLAM", 25)
       doPlayerSendTextMessage(cid, 25, "Success")
       doRemoveItem(tpos.uid, 1)
   else
       doSendMagicEffect(apos, 15)
       doPlayerSendTextMessage(cid, 25, "Failed.")
   end
   return true
end
 
ugh, we went over this before.
"bug" doesn't tell me much.

do some prints.
Lua:
function onSay(cid, words, param)
   apos = getPlayerPosition(cid)
   ppos = {x=apos.x, y=apos.y-1, z=apos.z, stackpos=1}
   tpos = getThingfromPos(ppos)
  
   print(tpos.uid)
   print(tpos.aid)
   if tpos.aid == 2765 then
       doSendMagicEffect(ppos, 5)
       doPlayerSay(cid, "EXORI FLAM", 25)
       doPlayerSendTextMessage(cid, 25, "Success")
       doRemoveItem(tpos.uid, 1)
   else
       doSendMagicEffect(apos, 15)
       doPlayerSendTextMessage(cid, 25, "Failed.")
   end
   return true
end
i've do but still i take a bug and nothing appear at the console
 
i've do but still i take a bug and nothing appear at the console
:s

try this then.
Make sure you install -> save file -> restart server
Lua:
function onSay(cid, words, param)
   apos = getPlayerPosition(cid)
   for i = 1, 255 do
       print("" .. i .. "" .. i .. "")
       ppos = {x = apos.x, y = apos.y - 1, z = apos.z, stackpos = i}
       tpos = getThingfromPos(ppos)
       print(tpos.uid)
       if tpos.uid > 0 then
           print(tpos.aid)
           if tpos.aid == 2765 then
               doSendMagicEffect(ppos, 5)
               doPlayerSay(cid, "EXORI FLAM", 25)
               doPlayerSendTextMessage(cid, 25, "Success")
               doRemoveItem(tpos.uid, 1)
               return true
           end
       else
           break
       end
   end
   doSendMagicEffect(apos, 15)
   doPlayerSendTextMessage(cid, 25, "Failed.")
   return true
end
 
Solution
:s

try this then.
Make sure you install -> save file -> restart server
Lua:
function onSay(cid, words, param)
   apos = getPlayerPosition(cid)
   for i = 1, 255 do
       print("" .. i .. "" .. i .. "")
       ppos = {x = apos.x, y = apos.y - 1, z = apos.z, stackpos = i}
       tpos = getThingfromPos(ppos)
       print(tpos.uid)
       if tpos.uid > 0 then
           print(tpos.aid)
           if tpos.aid == 2765 then
               doSendMagicEffect(ppos, 5)
               doPlayerSay(cid, "EXORI FLAM", 25)
               doPlayerSendTextMessage(cid, 25, "Success")
               doRemoveItem(tpos.uid, 1)
               return true
           end
       else
           break
       end
   end
   doSendMagicEffect(apos, 15)
   doPlayerSendTextMessage(cid, 25, "Failed.")
   return true
end
well this appear at console and i've got bug
11
70000
2765
 
Alright I got it I think.

change
Lua:
doPlayerSay(cid, 'EXORI FLAM', 25)
to
Lua:
doCreatureSay(cid, "EXORI FLAM", TALKTYPE_SAY)
 
copy from ice king script or 3_player_remove_stone
doCreateItem
Code:
function onStepIn(cid, item, pos)  
apos = getThingPos(item.uid)
tpos = getThingfromPos(apos)
ppos = {x=apos.x, y=apos.y-1, z=apos.z, stackpos=1}
doTeleportThing(cid, ppos)
crt = doCreateItem(cid,6731,1,apos)
doSetItemActionId(crt,2765)
end
i've reached this will working?
--edit
thanks xikini it's worked <3
 
Back
Top