• 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 Custom exeta res (challenge) spell help

Tufte

Active Member
Joined
Nov 19, 2007
Messages
652
Reaction score
25
Location
Norway
So I've made a function in source that challenges players, and it works. But I'm really bad at scripting spells, and I don't want to make a talk action if I can do it with a spell. This is my attempt:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onCastSpell(cid, var)

    if(isPlayer(variantToNumber(var))) then
        doChallengePlayer(cid, variantToNumber(var))
    elseif(isMonster(variantToNumber(var)) then
        doChallengeCreature(cid, variantToNumber(var))
    end
  
    return doCombat(cid, combat, var)
end
Basicaly, I just want the challenge spell to work as usual on monsters, but use my new doChallengePlayer when it is used on a player. With this code, nothing happens to monsters nor players.
 
Back
Top