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

TFS 1.X+ Por Wand Script for TFS 1.3

adriez

New Member
Joined
Aug 14, 2011
Messages
73
Reaction score
1
port for tfs 1.3 plz


Code:
local min, max = 15000000,15000000 --Ataque mínimo e ataque máximo

local w = {
    [1] = {ef = 46, sh = 29, dmg = COMBAT_POISONDAMAGE},
}

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
 
port for tfs 1.3 plz


Code:
local min, max = 15000000,15000000 --Ataque mínimo e ataque máximo

local w = {
    [1] = {ef = 46, sh = 29, dmg = COMBAT_POISONDAMAGE},
}

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
It's pretty easy to update things to 1.3. You can use this as a reference in the future so you can try yourself and start to learn how all the functions work. [Lua] TFS 1.3 Functions - Pastebin.com (https://pastebin.com/UNQc3Y7R)

Lua:
local min, max = 15000000,15000000 --Ataque mínimo e ataque máximo
local w = {
    [1] = {ef = 46, sh = 29, dmg = COMBAT_POISONDAMAGE},
}

function onUseWeapon(player, variant)
    local effect = player:getStorageValue(4561)
    local target = Creature(variant:getNumber())
    if target then
        local wx = w[effect] or w[math.random(#w)]
        local target_pos = target:getPosition()
        player:getPosition():sendDistanceEffect(target_pos, wx.sh)
        addEvent(addEvent(doAreaCombatHealth, 100, player.uid, wx.dmg, target_pos, 0, -min, -max, wx.ef))
    end
    return true
end
 
@Apollos
Lua Script Error: [Weapon Interface]
data/weapons/scripts/supervara.lua onUseWeapon
luaAddEvent(). callback parameter should be a function.
stack traceback:
[C]: in function 'addEvent'
data/weapons/scripts/supervara.lua:13: in function <data/weapons/scripts/supervara.lua:6>
 
@Apollos
Lua Script Error: [Weapon Interface]
data/weapons/scripts/supervara.lua onUseWeapon
luaAddEvent(). callback parameter should be a function.
stack traceback:
[C]: in function 'addEvent'
data/weapons/scripts/supervara.lua:13: in function <data/weapons/scripts/supervara.lua:6>
My bad lol. Change line 13 to this:
Lua:
addEvent(doAreaCombatHealth, 100, player.uid, wx.dmg, target_pos, 0, -min, -max, wx.ef)
 
Back
Top