• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

strange holes

mmheo

New Member
Joined
Sep 14, 2017
Messages
157
Reaction score
1
hello guys i have one question
how to make something like this work auto
121410101246gxnw05e66ymnnqra.jpg


tfs 0.4

???

bump

pumb
 
Last edited by a moderator:
Solution
this should work fine
Code:
local pos = {
   {x=1000, y=1000, z=7},
   {x=999, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
    for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1512).uid
doTransformItem(pos2, 1513)
    end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
   for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1513).uid
doTransformItem(pos2, 1512)
   end
setGlobalStorageValue(10245, -1)
        end
   return true
end
Hi! I need you to be more specific with the way you want those spikes to work.
By the way, please, edit the title of the thread. You can find many good title examples on the rules thread of this forum.
 
You need to find the 'hidden trap' tile id of that thing and then do some onStep function that would deal damage to the user and transform it to hidden one.

Thats the way I would do that.
 
You need to find the 'hidden trap' tile id of that thing and then do some onStep function that would deal damage to the user and transform it to hidden one.

Thats the way I would do that.
i know how to make it work by onstep i need it work if player walk on or no
 
I havent done anything like that yet.

My thoughts:

Do some function that we will endless loop, like

(pseudocode)
TransformToSpikes
If player on -> deal dmg
Wait 2 sec
TransformtoNOspikes
Wait 2 sec
Repeat

The problem is, we need to initialize the scripts for every item of that type on the map.

The very first solution might be adding the special action ID to them, and run the script at the startup for every item with that AID.
 
bro i need it work like globalevent every one min appear and disappear
The easiest way to do this is using a movement script, that you already know how to do (as you said) and using "decay to" in items.xml to make it become the first item again, before it triggers.
 
What about this:
LUA:
local pos = {
   {x=1000, y=1000, z=7},
   {x=999, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
    for i = 1, #pos do
local pos2 = getThingfromPos(pos[i]).uid
doTransformItem(pos2, 1513)
    end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
   for i = 1, #pos do
local pos2 = getThingfromPos(pos[i]).uid
doTransformItem(pos2, 1512)
   end
setGlobalStorageValue(10245, -1)
        end
   return true
end

I don't think so it will be working, but check out.

@edit this works, but it transforms every item on these tiles. Even the ground.
 
Last edited:
this should work fine
Code:
local pos = {
   {x=1000, y=1000, z=7},
   {x=999, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
    for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1512).uid
doTransformItem(pos2, 1513)
    end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
   for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1513).uid
doTransformItem(pos2, 1512)
   end
setGlobalStorageValue(10245, -1)
        end
   return true
end
 
Solution
hello guys i have one question
how to make something like this work auto
121410101246gxnw05e66ymnnqra.jpg


tfs 0.4

???

bump

pumb

Open items.xml
and then do this to the following ids to make them work like real tibia (note you still need an onStepIn function to take care of damaging the player)
Code:
<item id="1512" name="strange holes">
       <attribute key="decayTo" value="1513"/>
       <attribute key="duration" value="1"/>
   </item>
   <item id="1513" name="spikes">
       <attribute key="decayTo" value="1512"/>
       <attribute key="duration" value="3"/>
   </item>

Edit:
not sure if you could add something like this to the item whit id 1513 (spikes) instead of a lua script
Code:
<attribute key="healthGain" value="-60"/>

Edit2:
if you want the movement script
Code:
function onStepIn(cid, item, pos)
   if(item.itemid == 1513) then
       doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -60, CONST_ME_NONE)
       return true
   end
end
keep in mind players will only take damage if thay stepin on the spikes and not if thay still stand on the spikes, when thay appear. Not sure if players take damge if thay stand on the tile or only if thay step on it in real tibia
 
Last edited:
this should work fine
Code:
local pos = {
   {x=1000, y=1000, z=7},
   {x=999, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
   {x=1000, y=1000, z=7},
}
function onThink(interval, lastExecution)
if getGlobalStorageValue(10245) == -1 then
    for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1512).uid
doTransformItem(pos2, 1513)
    end
setGlobalStorageValue(10245, 1)
elseif getGlobalStorageValue(10245) == 1 then
   for i = 1, #pos do
local pos2 = getTileItemById(pos[i],1513).uid
doTransformItem(pos2, 1512)
   end
setGlobalStorageValue(10245, -1)
        end
   return true
end
work fine :D thx
 
Back
Top