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

Lua [TFS 1.0] If Player Is In Battle

Jaed Le Raep

★Gaeming★
Joined
Sep 3, 2007
Messages
1,295
Reaction score
441
Hey guys, I'm trying to add a thing in which if the player is in battle and they stepped on this tile, then it wouldn't work, but if they're not in battle, then it would work. The script is below, just can't figure out a parameter for it to work.

Code:
local delay = 5 * 1
local newpos = {x = 1068, y = 1047, z = 7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if (isPlayer(cid))  then
        addEvent(function(cid, block, newpos)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You begin to sink into the depths of the sinkhole.")
    if (isPlayer(cid)) then
        doTeleportThing(cid, newpos)
    end
    end, delay * 1000, cid, false, newpos)
    end
return true
end
 
Could I ask for a revamp of this script? Currently, all players have to do is stand on it once and they'll be teleported in 5 seconds. However, I'd like for them being forced to stay on that position for 5 seconds before they're teleported. The currently working version is the script is below. There's also another issue, that description only pops up when the player has sunk into the sinkhole. Originally the script had a noMove condition to it, but I had to remove it due to my new distro being TFS 1.0, and I've been unable to find a TFS 1.0 equivalent/replacement to the original

Code:
local delay = 5 * 1
local newpos = {x = 1068, y = 1047, z = 7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if (isPlayer(cid)) and (getCreatureCondition(cid, CONDITION_INFIGHT) == false) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You begin to sink into the depths of the sinkhole.")
        addEvent(function(cid, block, newpos)
    if (isPlayer(cid)) and (getCreatureCondition(cid, CONDITION_INFIGHT) == false) then
        doTeleportThing(cid, newpos)
    end
    end, delay * 1000, cid, false, newpos)
    end
return true
end


This is the original script made for TFS 0.4

Code:
[code=lua]local delay = 30 * 60
local newpos = {x = 0, y = 0, z = 0}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(isPlayer(cid)) then
doCreatureSetNoMove(cid, true)
addEvent(function(cid, block, newpos)
if(isPlayer(cid)) then
doCreatureSetNoMove(cid, block)
doTeleportThing(cid, newpos)
end
end, delay * 1000, cid, false, newpos)
end

return true
end
[/CODE]
 
Back
Top