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

New fishing rod tfs 0.4

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i have problem with this script. I want add new rod to fishing fish 10224 for item 9662 but i can fishing fish without item... How repair it?

Code:
local useWorms = true
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

math.randomseed(os.time())
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local fishSkill = getPlayerSkillLevel(cid, SKILL_FISHING)
    local fishChance = math.random(1, fishSkill)
    local wormCheck = false

    if isInArray(waterIds, itemEx.itemid) then
        if math.random(1, 100) <= math.min(math.max(10 + (fishSkill - 10) * 0.597, 10), 50) then
                if useWorms and getPlayerItemById(cid, true, 9662) then
                    wormCheck = true
                end

                if wormCheck then
                    if fishChance < 15 then
                        doPlayerAddItem(cid, 10224, 1)
                    elseif fishChance > 14 and fishChance < 30 then
                        doPlayerAddItem(cid, 10224, 1)
                    elseif fishChance > 29 and fishChance < 45 then
                        doPlayerAddItem(cid, 10224, 1)
                    elseif fishChance > 44 and fishChance < 60 then
                        doPlayerAddItem(cid, 10224, 1)
                    elseif fishChance > 59 and fishChance < 75 then
                        doPlayerAddItem(cid, 10224, 1)
                    elseif fishChance > 74 and fishChance < 90 then
                        doPlayerAddItem(cid, 10224, 1)
                    elseif fishChance > 89 then
                        doPlayerAddItem(cid, 10224, 1)
                    end

                    if useWorms then
                        doPlayerRemoveItem(cid, 9662, 1)
                    end
                end
            end

        doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
        return true
    end
    return false
end
 
Solution
The original script differs from yours, and all you would need to change is the item to remove, and what you get.

Its same scripts? xd i changed only ID fish, ID worms and wormCheck = TRUE
(Check script in post #8 from this topic - Simple Fishing System Request (https://otland.net/threads/simple-fishing-system-request.254209/))

And in this script u have
Code:
                    if useWorms then
                        doPlayerRemoveItem(cid, 9662, 1)
                    end

When i have item 9662 and i fishing i can get fish and i lose item 9662 but if i dont have item 9662 i still can fishing fish, so i think "wormsCheck" not work ;/ but idk how to reapir it

Sorry for bad english
Post automatically merged:

Okey nvm i repair...
Ez fix would be:
Remove your new fish from this script, create 2nd action script just for new rod (A copy of this).
 
ok question time

1. Do you mean replacement for worms?
But in your case its not taking new 'worms'? Correct?
 
ok question time

1. Do you mean replacement for worms?
But in your case its not taking new 'worms'? Correct?

Yep, item 9662 its a new "WORMS", i replaced ITEM_WORMS with id 9662 and when i fishsing with that item i lose 9662 and i get fish (10224) but if i dont have item_9662 i still can fishing new fish (10224)
 
The original script differs from yours, and all you would need to change is the item to remove, and what you get.
 
The original script differs from yours, and all you would need to change is the item to remove, and what you get.

Its same scripts? xd i changed only ID fish, ID worms and wormCheck = TRUE
(Check script in post #8 from this topic - Simple Fishing System Request (https://otland.net/threads/simple-fishing-system-request.254209/))

And in this script u have
Code:
                    if useWorms then
                        doPlayerRemoveItem(cid, 9662, 1)
                    end

When i have item 9662 and i fishing i can get fish and i lose item 9662 but if i dont have item 9662 i still can fishing fish, so i think "wormsCheck" not work ;/ but idk how to reapir it

Sorry for bad english
Post automatically merged:

Okey nvm i repair it, if someone need new fishing rod check it:

Code:
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}

math.randomseed(os.time())
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local fishSkill = getPlayerSkillLevel(cid, SKILL_FISHING)
    local fishChance = math.random(1, fishSkill)

    if isInArray(waterIds, itemEx.itemid) then
        if math.random(1, 100) <= math.min(math.max(10 + (fishSkill - 10) * 0.597, 10), 50) then

                if(doPlayerRemoveItem(cid, 9662, 1)) then
                        doPlayerAddItem(cid, 10224, 1)
                        doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
                        doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
                    else doCreatureSay(cid, "You don't have a NEW WORM!", TALKTYPE_ORANGE_1)
                end
            end

        return true
    end
    return false
end
 
Last edited:
Solution

Similar threads

Back
Top