• 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 -=[TFS]=- 0.4 v8.60 Effect show player vocation script here error

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Please Help
Lua:
efeitos = {
[13] = 51, 13 =  ID of the vocation that will have the effect, 51 ID of the effect, you can add more than one effect there

}

 

function onLogin(cid)

 

for voc, efec in pairs(efeitos) do

if voc == getPlayerVocation(cid) then

doEffect(cid)

break

end

end

return TRUE

end

 

function doEffect(cid)

 

local delay = 1

 

if isCreature(cid) == TRUE then

doSendMagicEffect(getCreaturePosition(cid), efeitos[getPlayerVocation(cid)])

addEvent(doEffect, delay*1000, cid)

end

return TRUE

end
 
Solution
Lua:
efeitos = {
    [2] = 41,
    [3] = 37,
    [4] = 31,
    [6] = 28,
    [7] = 27,
    [8] = 25
}
function doEffect(cid)
    local delay = 1
    if isCreature(cid) then
        local effect = efeitos[getPlayerVocation(cid)]
        local position = getCreaturePosition(cid)
        local toPositionLow = {z = position.z}
        local toPositionHigh = {z = position.z}

        toPositionLow.x = position.x - 7
        toPositionHigh.x = position.x + 7
        for i = -5, 5 do
            toPositionLow.y = position.y + i
            toPositionHigh.y = toPositionLow.y
            doSendDistanceShoot(getCreaturePosition(cid), toPositionLow, effect)
            doSendDistanceShoot(getCreaturePosition(cid), toPositionHigh, effect)
        end...
Which error is it showing?
Though I bet is here:
Lua:
efeitos = {
[13] = 51, 13 =  ID of the vocation that will have the effect, 51 ID of the effect, you can add more than one effect there

}
Just coment after 51,
Lua:
efeitos = {
[13] = 51, --13 =  ID of the vocation that will have the effect, 51 ID of the effect, you can add more than one effect there

}
 
efeitos = {

[2] = 41,

[3] = 37,

[4] = 31,

[6] = 28,

[7] = 27,

[8] = 25

}

function doEffect(cid)

local delay = 1

if isCreature(cid) == TRUE then

doSendMagicEffect(getCreaturePosition(cid), efeitos[getPlayerVocation(cid)])

addEvent(doEffect, delay*1000, cid)

end

return TRUE

end

function onLogin(cid)

for voc, efec in pairs(efeitos) do

if voc == getPlayerVocation(cid) then

doEffect(cid)

break

end

end

return TRUE

end



help me tplease to ransform - doSendMagicEffect = doSendDistanceShoot
 
Last edited:
doSendDistanceShoot you need to specify from where to where you want the effect be done, I can't help if you don't give more info
 
Lua:
efeitos = {
    [2] = 41,
    [3] = 37,
    [4] = 31,
    [6] = 28,
    [7] = 27,
    [8] = 25
}
function doEffect(cid)
    local delay = 1
    if isCreature(cid) then
        local effect = efeitos[getPlayerVocation(cid)]
        local position = getCreaturePosition(cid)
        local toPositionLow = {z = position.z}
        local toPositionHigh = {z = position.z}

        toPositionLow.x = position.x - 7
        toPositionHigh.x = position.x + 7
        for i = -5, 5 do
            toPositionLow.y = position.y + i
            toPositionHigh.y = toPositionLow.y
            doSendDistanceShoot(getCreaturePosition(cid), toPositionLow, effect)
            doSendDistanceShoot(getCreaturePosition(cid), toPositionHigh, effect)
        end

        toPositionLow.y = position.y - 5
        toPositionHigh.y = position.y + 5
        for i = -6, 6 do
            toPositionLow.x = position.x + i
            toPositionHigh.x = toPositionLow.x
            doSendDistanceShoot(getCreaturePosition(cid), toPositionLow, effect)
            doSendDistanceShoot(getCreaturePosition(cid), toPositionHigh, effect)
        end
        addEvent(doEffect, delay * 1000, cid)
    end
end


function onLogin(cid)
    for voc, efec in pairs(efeitos) do
        if voc == getPlayerVocation(cid) then
            doEffect(cid)
            break
        end
    end
    return true
end
There is it. I haven't tested it but should work.
A tip: next time you send a script here, please send then correctly indented for better reading, you got luck that this is a small script, a big one would be hell to read.
 
Solution

Similar threads

Back
Top