• 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 8.60 Effect Attack Weapon - how do i put these effects

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
View attachment 77368View attachment 77369View attachment 77370View attachment 77371View attachment 77372Screenshot_1.pngScreenshot_2.pngScreenshot_3.pngScreenshot_4.pngScreenshot_5.png[



Lua:
local min, max = 1000000000,1000000000 --Ataque mínino e ataque máximo

local w = {
    [1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
    [2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
    [3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE},
    [4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
    [5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
    [6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE},
    [7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(cid, var)
        local effect = getPlayerStorageValue(cid, 4561)
        local target = getCreatureTarget(cid)
    
        if target ~= 0 then
                local wx = w[effect] or w[math.random(#w)]
                doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
                addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
        end
        return true
end
 
Last edited:
TFS version? You are forgetting to include this so often (You should have known this by now). Not everyone can tell your TFS version by reading the script functions, and no one has to check your older threads to know which TFS you're using.

Read Support Board Rules and put some effort into creating your threads to get faster help.
 
Back
Top