• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Fishing Record Script wont work

Samaster

Raptorserver.ddns.net
Joined
Jun 9, 2013
Messages
291
Reaction score
23
Location
UK
I need a professional scripter to help me here :/
I want a script that when player:
1) says '!fishing'
2) brings up a text dialogue (like !spells brings up a book)
3) views all the fishing monsters and views a count of how many times the player has caught the monster

This is my script so far, i dont know what im doing so need some help :/
Code:
function onSay(cid, words, param, channel)
if (isPlayer(param)) then
local monsters =
{"angry water elemental",
"ophion slave",
"hydraphon",
"hydrilica",
"blood crab",
"mature blood crab",
"giant squid",
"ophion",
"megladon",
"immature sharkeater",
"the lurker",
"aquafilus",
"sharkeater"}
local monster1 = getPlayerStorageValue(cid, monsters[1])
local monster2 = getPlayerStorageValue(cid, monsters[2])
local monster3 = getPlayerStorageValue(cid, monsters[3])
local monster4 = getPlayerStorageValue(cid, monsters[4])
local monster5 = getPlayerStorageValue(cid, monsters[5])
local monster6 = getPlayerStorageValue(cid, monsters[6])
local monster7 = getPlayerStorageValue(cid, monsters[7])
local monster8 = getPlayerStorageValue(cid, monsters[8])
local monster9 = getPlayerStorageValue(cid, monsters[9])
local monster10 = getPlayerStorageValue(cid, monsters[10])
local monster11 = getPlayerStorageValue(cid, monsters[11])
local monster12 = getPlayerStorageValue(cid, monsters[12])
local monster13 = getPlayerStorageValue(cid, monsters[13])
doShowTextDialog(cid, 1950, text)
local text = "[FISHING]: /n Angry Water Elemental: " .. monster1 .. "/n Ophion Slave: " .. monster2 .. "/n Hydraphon: " .. monster3 .."/n Hydrilica: " .. monster4 .."/n Blood Crab: " .. monster5 .."/n Mature Blood Crab: " .. monster6 .."/n Giant Squid: " .. monster7 .."/n Ophion: " .. monster8 .."/n Megladon: " .. monster9 .."/n Immature Sharkeater: " .. monster10 .."/n The Lurker: " .. monster11 .."/n Aquafilus: " .. monster12 .."/n Sharkeater: " .. monster13 ..""
else
doShowTextDialog(cid, 1950, text)
end
end
 
Last edited:
Code:
local monsters = {
   {"Angry Water Elemental", 36000},
   {"Ophion Clave", 36001},
   {"Hydraphon", 36002},
   {"Hydrilica", 36003},
   {"Blood Crab", 36004},
   {"Mature Blood Crab", 36005},
   {"Giant Squid", 36006},
   {"Ophion", 36007},
   {"Megladon", 36008},
   {"Immature Sharkeater", 36009},
   {"The Lurker", 36010},
   {"Aquafilus", 36011},
   {"Sharkeater", 36012}
}

function onSay(cid, words, param, channel)

     local text = "[FISHING]:"
     for _, m in pairs(monsters) do
         if(getPlayerStorageValue(cid, m[2]) == -1) then
             setPlayerStorageValue(cid, m[2], 0)
         end
         text = text .."\n"..m[1]..": "..getPlayerStorageValue(cid, m[2])
     end
     doShowTextDialog(cid, 2175, text)
     return true
end
 
@Limos this is what comes up on a character that has never fished before :/
Code:
[FISHING]:
Angry water elemental: 5000
Ophion slave: 5000
Hydraphon: 5000
Hydrilica: 5000
Blood crab: 5000
Mature blood crab: 5000
Giant squid: 5000
Ophion: 5000
Megladon: 5000
Immature sharkeater: 5000
The lurker: 5000
Aquafilus: 5000
Sharkeater: 5000
 
yes i get this
Code:
Angry water elemental: -1
Ophion slave: -1
Hydraphon: -1
Hydrilica: -1
Blood crab: -1
Mature blood crab: -1
Giant squid: -1
Ophion: -1
Megladon: -1
Immature sharkeater: -1
The lurker: -1
Aquafilus: -1
Sharkeater: -1
 
This script just sets storagevalues after the monster names in a textdialog.
If the storages aren't correct, look in your fishing script for the correct ones and change them or if they are not there add them.
Every time you fish a monster it should give +1 storagevalue of the storage of that monster.
 
This script just sets storagevalues after the monster names in a textdialog.
If the storages aren't correct, look in your fishing script for the correct ones and change them or if they are not there add them.
Every time you fish a monster it should give +1 storagevalue of the storage of that monster.

Yes the script does what you say it does, however the storage values do not go up when i fish a monster :/
 
Fishing Script:

Code:
local config =  {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
    rateSkill = 2,
    allowFromPz = false,
    useWorms = false
}
local v = {
    [{300,100}] = {name = "Angry Water Elemental", chance = 12000},
    [{400,100}] = {name = "Ophion Slave", chance = 2500},
    [{500,100}] = {name = "Hydraphon", chance = 2000},
    [{1000,110}] = {name = "Hydrilica", chance = 1400},
    [{1500,110}] = {name = "Blood Crab", chance = 1000},
    [{2000,115}] = {name = "Mature Blood Crab", chance = 600},
    [{2000,115}] = {name = "Giant Squid", chance = 400},
    [{2500,120}] = {name = "Ophion", chance = 70},
    [{3000,130}] = {name = "Megladon", chance = 60},
    [{3000,130}] = {name = "Immature Sharkeater", chance = 50},
    [{4000,135}] = {name = "The Lurker", chance = 40},
    [{5000,140}] = {name = "Aquafilus", chance = 30},
    [{6000,140}] = {name = "Sharkeater", chance = 10}
}
     
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isInArray(config.waterIds, itemEx.itemid) then
        return false
    end
    if (config.allowFromPz or not getTileInfo(getThingPos(cid)).protection)  and itemEx.itemid ~= 493 and math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 50))) <  getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and  doPlayerRemoveItem(cid, ITEM_WORM, 1))) then
        local bsMessage = "%s have caught %s"
        for i, k in pairs(v) do
            if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
                local c = math.random(10000000)
                if c <= k.chance then
                    doSummonCreature(k.name, getThingPos(cid))
                end
            end
            if k.broadcast then
                doBroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
                break
            end
        end
    end
    if doPlayerAddSkillTry(cid, SKILL_FISHING, 1) then
    return doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
end
end
 
This script doesn't add storage, I edited the talkaction script a bit.
Code:
local monsters = {
   {"Angry Water Elemental", 36000},
   {"Ophion Clave", 36001},
   {"Hydraphon", 36002},
   {"Hydrilica", 36003},
   {"Blood Crab", 36004},
   {"Mature Blood Crab", 36005},
   {"Giant Squid", 36006},
   {"Ophion", 36007},
   {"Megladon", 36008},
   {"Immature Sharkeater", 36009},
   {"The Lurker", 36010},
   {"Aquafilus", 36011},
   {"Sharkeater", 36012}
}

function onSay(cid, words, param, channel)

     local text = "[FISHING]:"
     for _, m in pairs(monsters) do
         if(getPlayerStorageValue(cid, m[2]) == -1) then
             setPlayerStorageValue(cid, m[2], 0)
         end
         text = text .."\n"..m[1]..": "..getPlayerStorageValue(cid, m[2])
     end
     doShowTextDialog(cid, 2175, text)
     return true
end
Add those storages as "storage = 36000" etc in the local v table to the right monsters.
Example
Code:
[{300,100}] = {name = "Angry Water Elemental", chance = 12000, storage = 36000},

Then add this under the line where it creates the monster.
Code:
setPlayerStorageValue(cid, k.storage, getPlayerStorageValue(cid, k.storage) +1)
 
Back
Top