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

[َquestion]script floor add Health

In movements create lua file rename it "healing tile" and copy these lines
Code:
local pos = getCreaturePosition(cid)
local health = xxx 
local tileid = xxx 
function onStepIn(cid, item, frompos, itemEx, topos)
if item.itemid == tileid then
doCreatureAddHealth(cid, health)
doSendMagicEffect(pos, x)
end
return true
end

In movements.xml add this line
Code:
<movement type="StepIn" actionid="xxxx" event="script" value="healing tile.lua"/>
 
pos = position aka map location
Example: {x=111, y=222, x=333}

x = ENUM

magic effects enums start with CONST_ME_
From your const.h file (in sourcecode) you can find the list of ENUMS
Or look at this: https://otland.net/threads/tfs-1-x-enums.225588/
no... :p In this script he used an action id, which means to make it effective in the game you will have to double click that floor & set the same action id as lucian put in the script (you can change it of course.)
 
no... :p In this script he used an action id, which means to make it effective in the game you will have to double click that floor & set the same action id as lucian put in the script (you can change it of course.)
The actionId has nothing to do with what's in the script. It's quite unnecessary to check for, when that's the one thing that's checked for in game, unless you have multiple different actions executed in the same script, then you would need to assign different actionids and check for them. Just like checking for the tiles itemId is completely pointless.

But as far as this simple script goes, you don't need to check for actionid or tile itemId
 
Ex.
local pos = getCreaturePosition(cid)
local health = xxx
local tileid = xxx
function onStepIn(cid, item, frompos, itemEx, topos)
if item.itemid == tileid then
doCreatureAddHealth(cid, health)
doSendMagicEffect
pos = position aka map location
Example: {x=1000, y=995, x=7}
end
return true
end
 
In movements create lua file rename it "healing tile" and copy these lines
Code:
local pos = getCreaturePosition(cid)
local health = xxx
local tileid = xxx
function onStepIn(cid, item, frompos, itemEx, topos)
if item.itemid == tileid then
doCreatureAddHealth(cid, health)
doSendMagicEffect(pos, x)
end
return true
end

In movements.xml add this line
Code:
<movement type="StepIn" actionid="xxxx" event="script" value="healing tile.lua"/>
Your onStepIn function is wrong. Your calling actionscript functions.
Code:
function onStepIn(cid, item, position, fromPosition)
   doCreatureAddHealth(cid, 100)
   doSendMagicEffect(position, 35) -- 35 = hearts, 14 = green sparkle
   return true
end
Code:
<movement type="StepIn" actionid="45001" event="script" value="healing_tile.lua"/>
 
i am Sorry but I am new and do not know much about this site :(
Don't worry about it.
There's some people who tend to notice 'leechers' more then others.
If someone is getting up to 500-1000 posts, and still doesn't look like they are trying to figure out problems on their own, then we should be noticing them.
Just continue building your ot, and getting accustomed to the site.
We really do enjoy having new members, and value any contributions you give to the community.

Cheers,

Xikini
 
Back
Top