• 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 Talkaction !promote TFS 1.0

psilocibe

Member
Joined
Jul 9, 2007
Messages
479
Reaction score
8
How do I do talkaction to promote promotion 1.0 in tfs?

Ex: !Promote

Does anyone know of any script?
 
Code:
    local promotion = player:getVocation():getPromotion()
    if not promotion or promotion:getId() == 0 then
        return true
    end

    player:setVocation(Vocation(promotion:getId()))
 
Code:
function onSay(cid, words, param)
    local player = Player(cid)
    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need a premium account in order to get promoted.')
        return false
    end

    local promotion = player:getVocation():getPromotion()
    if not promotion or promotion:getId() == 0 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are already promoted!')
        return false
    end

    player:setVocation(Vocation(promotion:getId()))
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are now promoted.')
    return false
end
 
You have to write this type of threads in [Request].
Ok sry.

Code:
function onSay(cid, words, param)
    local player = Player(cid)
    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need a premium account in order to get promoted.')
        return false
    end

    local promotion = player:getVocation():getPromotion()
    if not promotion or promotion:getId() == 0 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are already promoted!')
        return false
    end

    player:setVocation(Vocation(promotion:getId()))
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are now promoted.')
    return false
end

Look this error.

data/talkactions/scripts/promote.lua:eek:nSay
data/talkactions/scripts/promote.lua:3: attempt to call method 'isPremium' (a nil value)
stack traceback:
[C]: in function 'isPremium'
data/talkactions/scripts/promote.lua:3: in function <data/talkactions/scripts/promote.lua:1>
 
Back
Top