darkjav
Senior Developer
Hi, i'm trying to make a paralyze rune like Tibia Rl, this should work as follows:
If the player have equipment that increases the speed, for example prismatic armor, grasshopper legs, boots of haste, time of ring, etc.
Then the paralyze rune must decrease speed to 40, and if the player does not have any equipment that raises the speed, he must also decrease to 40
Does not matter if player have equipment or not.
Code:
But i get error:
I appreciate your help, thanks.
If the player have equipment that increases the speed, for example prismatic armor, grasshopper legs, boots of haste, time of ring, etc.
Then the paralyze rune must decrease speed to 40, and if the player does not have any equipment that raises the speed, he must also decrease to 40
Does not matter if player have equipment or not.
Code:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
--condition:setFormula(-1, 80, -1, 80)
condition:setFormula(-1, ((creature:getSpeed() * 0) + 80), -1, ((creature:getSpeed() * 0) + 80))
combat:setCondition(condition)
function onCastSpell(creature, variant, isHotkey)
if not combat:execute(creature, variant) then
return false
end
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
return true
end
But i get error:
Lua Script Error: [Test Interface]
data/spells/scripts/support/paralyze rune.lua
data/spells/scripts/support/paralyze rune.lua:7: attempt to index global 'creature' (a nil value)
stack traceback:
[C]: in function '__index'
data/spells/scripts/support/paralyze rune.lua:7: in main chunk
[C]: in function 'reload'
data/talkactions/scripts/reload.lua:76: in function <data/talkactions/scripts/reload.lua:59>
[Warning - Event::checkScript] Can not load script: scripts/support/paralyze rune.lua
I appreciate your help, thanks.
Last edited: