• 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 Script Freeze Rune (Bug Character)

Gaber Zen

Well-Known Member
Joined
Apr 22, 2023
Messages
242
Reaction score
62
Location
Egypt
Hello Guys
I have problem, Script Action Freze Rune After Time down Player Don`t move or logout.
Tibia 8.6 -TFS V
tfs.png
local freezetime = 5
local cooldown = 10 -- time to use again
local storage = 19002
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, exhaust)
local exhaustt = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaustt, CONDITION_PARAM_SUBID, 2)
setConditionParam(exhaustt, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, exhaustt)
function countDown(number, pos, effect, msgonend, effectonend)
local n = number
for i = 1, number do
addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )
n = n -1
end
n = number
return true
end
function removed(cid)
doCreatureSetNoMove(cid, 0)
doRemoveCondition(cid,CONDITION_EXHAUST,1)
doRemoveCondition(cid,CONDITION_EXHAUST,2)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if exhaustion.get(cid,storage) then
return doPlayerSendCancel(cid,"You can't use this yet.")
end
if getTilePzInfo(toPosition) == true then
return doPlayerSendCancel(cid, "You cant use in pz.")
end

if not isPlayer(itemEx.uid) or cid == itemEx.uid then
return doPlayerSendCancel(cid,"You can only use this on another players.")
end
doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", TEXTCOLOR_BLUE)
exhaustion.set(cid,storage,cooldown)
doCombat(cid, combat, numberToVariant(itemEx.uid))
doCreatureSetNoMove(itemEx.uid, 1)
countDown(freezetime , toPosition, 0, "melted", 5)
addEvent(removed,freezetime*1000,itemEx.uid)
return true
end
<action itemid="7289" allowfaruse="1" event="script" value="freeze.lua"/>
 
Solution
Tested and it works. When you use a rune on the target player, it silences them, preventing them from using mana potions only.

freeze.lua
Lua:
local config = {
    freezetime = 5,
    cooldown = 10,
    storage = 19002,
    combat = createCombatObject(),
    exhaust = createConditionObject(CONDITION_EXHAUST),
    exhaustt = createConditionObject(CONDITION_EXHAUST)
}

setCombatParam(config.combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatParam(config.combat, COMBAT_PARAM_AGGRESSIVE, false)

setConditionParam(config.exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(config.exhaust, CONDITION_PARAM_TICKS, config.cooldown * 1000)
setConditionParam(config.exhaustt, CONDITION_PARAM_SUBID, 2)...
I added a check for exhaustion for storage 19002, just like the other script does...

If that doesn't work, then i dont know why, because it should work... good luck!

p.s upgrade to 1.4....
 
Back
Top