• 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 Fishing script working on tfs 3.6+?

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
I actually got this script, but i need it so every /item/monster have a % chance of being caught.


Code:
local stuff = { 
    [{85001, 87000}] = 2159, 
    [{87001, 88000}] = 2143, 
    [{88001, 89000}] = 2144, 
    [{89001, 95000}] = 'Water Elemental', 
    [{95001, 99000}] = 'Serpent Spawn', 
    [{99001, 100000}] = 'Fire Elemental', 
} 
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if itemEx.itemid == 4625 then 
        local rand = math.random(100000) 
        for r, v in pairs(stuff) do 
            if rand >= r[1] and rand <= r[2] then 
                if type(v) == 'number' then 
                    doPlayerAddItem(cid, 2160, math.random(50, 100)) 
                else 
                    doSummonCreature(v, toPosition) 
                end 
                break 
            end 
        end 
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY) 
        doPlayerAddSkillTry(cid, SKILL_FISHING, 1) 
    else 
        return FALSE 
    end 
    return TRUE 
end

haalp a noob plis
 
It already works with chance, if you want it to work with %, just remove the last 3 numbers, so it's in % (also don't forget to edit them so a % is not used 2x).
 
I cant get the right line so the monster appear next to player and not "there" , i changed water id to un-walkable water, so it doesnt "pop" and the items listed at the top of the script arent obtainable.... maybe becuz the line isnt appropriate? [ if type(v) == 'number' then
doPlayerAddItem(cid, 2160, math.random(1, 100)) ]

again.. Idk ;p
:| help?
 
Back
Top