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

Solved On Step Learn Spell

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
MnVwR8yT.png



here is error. code:

Code:
function onStepIn(cid, item, position, fromPosition)

local spell = "Light"

if not getPlayerLearnedInstantSpell(cid, spell) then
doPlayerLearnInstantSpell(cid, spell)


        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned spell " .. spell .. "!")
        doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    else
        doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
    end
    return true
end


Tfs 1.0 not working at all where problem... :/ ?
 
Last edited:
3GuuxEl.png




New code:

Code:
function onStepIn(cid, item, position, fromPosition)

local spell = "Light"

if not getPlayerLearnedInstantSpell(cid, spell) then
doPlayerLearnInstantSpell(cid, spell)


        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned spell " .. spell .. "!")
        doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    else
        doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
    end
    return true
end


and not working, any suggestions?
 
Code:
function onStepIn(cid, item, position, fromPosition)
    local player = Player(cid)
    if not player then
        return true
    end

    local spell = 'Light'
    if player:hasLearnedSpell(spell) then
        player:say('You already know this spell!', TALKTYPE_MONSTER_SAY)
        return true
    end

    player:learnSpell(spell)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have learned the spell ' .. spell .. '!')
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    return true
end
 
Back
Top