• 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 [0.3.6] Lava Fishing doesn't work

Samaster

Raptorserver.ddns.net
Joined
Jun 9, 2013
Messages
291
Reaction score
23
Location
UK
Hi, I thought it would be as easy as copying the normal fishing script, just changing some things but it doesn't work. No errors come up but when I use the lava fishing spear it says 'You cannot use this object'.
Can someone help please?
Lava Fishing script:
Code:
local config =  {
    waterIds = {598},
    rateSkill = 0.5,
    allowFromPz = false,
    useWorms = false
}

local t = {
        targetId = 0,
        SpeakClasses = TALKTYPE_CHANNEL_R,
        message = '',
        channel = 12
    }
   
local v = {
    [{500,120}] = {name = "Blazing Soul", one = 1000000, storage = 36014}
}
      
function reallyLongReturn(cid, config)
    return math.random((100 + (getPlayerSkill(cid, SKILL_FISHING) / 60))) <  getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and  doPlayerRemoveItem(cid, ITEM_WORM, 1)))
end
   
function onUse(cid, item, fromPosition, itemEx, toPosition)
    t.targetId = getPlayerGUID(cid)
    if not isInArray(config.lavaIds, itemEx.itemid) then
        return false
    end
    if getTilePzInfo(getPlayerPosition(cid)) then
         doPlayerSendCancel(cid, "You can't lava fish inside a protection zone.")
         return false
    end
    if itemEx.itemid ~= 598 then
        for i, k in pairs(v) do
            if getPlayerLevel(cid) >= i[1] and getPlayerSkillLevel(cid, SKILL_FISHING) >= i[2] then
                local c = math.random(2110000000)
                if c <= k.one then
                    t.message = getPlayerName(cid).." has been burnt by the super heat of a ".. k.name .." [".. getPlayerLevel(cid) .."]."
                    doSummonCreature(k.name, getThingPos(cid))
                    doSendMagicEffect(getThingPos(cid), 4)
                    setPlayerStorageValue(cid, k.storage, getPlayerStorageValue(cid, k.storage) +1)
                    for _, pid in ipairs(getPlayersOnline()) do
                    doPlayerSendChannelMessage(pid, t.targetId, t.message, t.SpeakClasses, t.channel)
                end
                end
            end
            if k.broadcast then
                doBroadcastMessage(bsMessage:format(getCreatureName(cid), k.name))
                break
            end
        end
    end
    doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
    doSendMagicEffect(toPosition, 6)
end

Actions.xml:
Code:
    <action itemid="2580" event="script" value="tools/fishing.lua" allowfaruse="1"/>
    <action itemid="10223" event="script" value="tools/upgfishing.lua" allowfaruse="1"/>
    <action itemid="3964" event="script" value="tools/lava fishing.lua"/>

Thank you!
 
Okay, can you see anything else wrong with it?
Parts of the script are missing, please provide the original unedited version, although I really do recommend you learning the basics of lua if you are going to edit scripts.

Like what tables, variables are, and how they are assigned and how their values are accessed, what scope is, iterators (loops), functions, passing arguments to parameters, returning a value, these are really import things to know, you don't need to master the language you just need to have a basic understanding :)
 
Back
Top