• 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 1.2 Creaturescripts help

Sekin

New Member
Joined
Sep 10, 2009
Messages
20
Reaction score
0
I have script "Aura" but i dosnt know why does not work :S
0 Reactions
Scrypts like this:
Lua:
local config =
{
[2] = {x = {
            efe= 2,
            hp= 25,
            mn= 12,
            efesum= 2
             }
         },
[31] = {x = {
            efe= 14,
            hp= 30,
            mn= 20,
            efesum= 16
             }
         },
}

function onThink(cid, interval)
addevent(aura, 2000)
end

function aura(player, creature, interval)

summon = config[getCreatureOutfit(getCreatureSummons(cid)[1]).lookType]

    if creature:isPlayer() then
        creature:getPosition():sendMagicEffect(summon.x.efe)
        creature:addHealth(summon.x.hp)
        creature:addMana(summon.x.mn)
    player:addManaSpent(player:getVocation():getRequiredManaSpent(player:getBaseMagicLevel() + summon.x.mp) - player:getManaSpent())
        local summons = creature:getSummons()
        for i = 1, #summons do
            summons[i]:getPosition():sendMagicEffect(summon.x.efesum)
        end
    addevent(aura, 2000)
    end
    return true
end

Can somebody help me ? :)
 
I have script "Aura" but i dosnt know why does not work :S
0 Reactions
Scrypts like this:
Lua:
local config =
{
[2] = {x = {
            efe= 2,
            hp= 25,
            mn= 12,
            efesum= 2
             }
         },
[31] = {x = {
            efe= 14,
            hp= 30,
            mn= 20,
            efesum= 16
             }
         },
}

function onThink(cid, interval)
addevent(aura, 2000)
end

function aura(player, creature, interval)

summon = config[getCreatureOutfit(getCreatureSummons(cid)[1]).lookType]

    if creature:isPlayer() then
        creature:getPosition():sendMagicEffect(summon.x.efe)
        creature:addHealth(summon.x.hp)
        creature:addMana(summon.x.mn)
    player:addManaSpent(player:getVocation():getRequiredManaSpent(player:getBaseMagicLevel() + summon.x.mp) - player:getManaSpent())
        local summons = creature:getSummons()
        for i = 1, #summons do
            summons[i]:getPosition():sendMagicEffect(summon.x.efesum)
        end
    addevent(aura, 2000)
    end
    return true
end

Can somebody help me ? :)

Lua:
addevent(aura, 2000)
You are not passing anything

Lua:
function aura(player, creature, interval)
Lua:
if creature:isPlayer() then
 
I dont understand you.
Im newbie on Lua,Xml etc.

In that case you should read up on Lua abit more.
Lua:
function onThink(cid, interval)
To start off, you don't have "cid" in onThink.

Idk where you got this script, but it can't work as it is.
You need these arguments;
Lua:
player, creature, interval

You have interval, but not player or creature.

Im not sure what you are trying to do, but you can loop all players online and get a player userdata.

Ex; server/checkMount.lua at master · orts/server · GitHub
 
I give up :C
this script had send effect on player and summon + restore heal, mana but work only if player have summon (check summon look type) then give bonus and effect XD
 
Back
Top