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

This fuctions can only be used while loading the script

Sekin

New Member
Joined
Sep 10, 2009
Messages
20
Reaction score
0
Hi, I have a problem I can not solve it: /

Code:
local config = {
[1] = { 25, 2, 840, 208},
[2] = { 50, 3, 91, 208},
[3] = { 75, 4, 841, 208},
[4] = { 100, 5, 676, 208},
[5] = { 125, 6, 842, 208},
[6] = { 150, 7, 40, 208},
[7] = { 175, 8, 305, 208},
[8] = { 200, 9, 677, 208},
[9] = { 225, 10, 686, 208},
[10] = { 250, 11, 179, 208},
[11] = { 275, 12, 683, 208},
[12] = { 300, 13, 397, 208},
[13] = { 400, 14, 607, 208},
[14] = { 425, 15, 752, 208},
[15] = { 500, 16, 875, 208},

}


local przyrost = createConditionObject(CONDITION_ATTRIBUTES)

function onSay(cid, words, param, channel)
local voc = config[getPlayerVocation(cid)]

if voc then

setConditionParam(przyrost, CONDITION_PARAM_TICKS, -1)
setConditionParam(przyrost, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, voc[4])
setConditionParam(przyrost, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, voc[4])
end


if (getPlayerStorageValue(cid,112) > 0) then
return doPlayerSendCancel(cid, "raz dwa trzy")
end
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doAddCondition(cid, przyrost)

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Potrzebujesz " .. voc[1] .. " poziomu.")
end
else
doPlayerSendCancel(cid, "Nie!")
end
return true
end

Console debug:

[Error - TalkAction Interface]
data/talkactions/scripts/trans.lua:eek:nSay
Description:
<luaSetConditionParam> This fuctions can only be used while loading the script.

Only work change vocation and outfit + effect
but dont give Health and Mana :/
 
Last edited by a moderator:
This should work but you will need to update the table
Code:
    local config = {
        [1] = {
            lvl = 25,
            newVoc = 2,
            lookType = 840,
            points = 208
            -- google translate -- tylko nie 1st jednego można zrobić resztę
        }, -- only did the 1st one you can do the rest
        [2] = { 50, 3, 91, 208},
        [3] = { 75, 4, 841, 208},
        [4] = { 100, 5, 676, 208},
        [5] = { 125, 6, 842, 208},
        [6] = { 150, 7, 40, 208},
        [7] = { 175, 8, 305, 208},
        [8] = { 200, 9, 677, 208},
        [9] = { 225, 10, 686, 208},
        [10] = { 250, 11, 179, 208},
        [11] = { 275, 12, 683, 208},
        [12] = { 300, 13, 397, 208},
        [13] = { 400, 14, 607, 208},
        [14] = { 425, 15, 752, 208},
        [15] = { 500, 16, 875, 208},
    }
 
 
    local przyrost = {}
    -- generate a table of condition_attributes
    for index, table_ in ipairs(config) do
        przyrost[index] = createConditionObject(CONDITION_ATTRIBUTES)
        setConditionParam(przyrost[index], CONDITION_PARAM_TICKS, -1)
        setConditionParam(przyrost[index], CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, table_['points'])
        setConditionParam(przyrost[index], CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, table_['points'])
    end


    function onSay(cid, words, param, channel)
        local oldVoc = getPlayerVocation(cid)
        local voc = config[oldVoc]
        if voc == nil then
            return false
        end

        if (getPlayerStorageValue(cid, 112) > 0) then
            return doPlayerSendCancel(cid, "raz dwa trzy")
        end
     
        local lvl = getPlayerLevel(cid)
        if voc then
            if lvl >= voc['lvl'] then
                doPlayerSetVocation(cid, voc['newVoc'])
                local outfit = { lookType = voc['lookType'] }
                doCreatureChangeOutfit(cid, outfit)
                doAddCondition(cid, przyrost[oldVoc])
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Potrzebujesz " .. voc['lvl'] .. " poziomu.")
            end
        else
            doPlayerSendCancel(cid, "Nie!")
        end
        return true
    end
 
Last edited:
[Error - TalkAction Interface]
data/lib/clan system.lua
Description:
data/lib/clan system.lua:9: table index is nil
[Warning - LuaScriptInfterface::initState] Cannot load data/lib/
Next Error :/
 
ok, I am going to ignore all posts that don't use code tags or posts that don't contain code or enough information to understand what the problem is.. oh wait I do that now.
To be fair it is a new member. :p
Just keep a copy paste of the Support Section Rules and How to ask for help properly.
If we don't pay attention to new members we might scare them into never posting their problems. :(

@Topic, we will need you to post the code in either case. :p
 
To be fair it is a new member. :p
Just keep a copy paste of the Support Section Rules and How to ask for help properly.
If we don't pay attention to new members we might scare them into never posting their problems. :(

@Topic, we will need you to post the code in either case. :p
Its not a new member, the account is from 2009, its most likely an alt account.
They have at least one other thread which was created in April of 2014.
Sekin
Joined:
Sep 10, 2009
Messages:
3
 
I am wasting my bandwidth trying to prove a point to 99.999999 to infinity of the people who read this.
 
Back
Top