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

Lua Floor fishing skill

fafor

New Member
Joined
Mar 7, 2010
Messages
7
Reaction score
0
Hello i would like to get script which gives fishing by walking on it.

function onStepIn(cid, item, position, fromPosition)
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
return true
end

Gives me error:
[04/07/2016 22:17:34] [Error - MoveEvents Interface]
[04/07/2016 22:17:34] data/movements/scripts/water.lua:eek:nStepIn
[04/07/2016 22:17:34] Description:
[04/07/2016 22:17:34] (luaDoPlayerAddSkillTry) Player not found

water.lua:

function onStepIn(cid, item, pos, lastPosition, fromPosition, toPosition, actor)
return doSendMagicEffect(toPosition, 32)
end

function onStepIn(cid, item, position, fromPosition)
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
return true
end

Movements.xml:

<!-- Uffox tiles -->
<movevent type="StepIn" itemid="4820" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4821" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4822" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4823" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4824" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4825" event="script" value="water.lua"/>
 
Last edited:
Looks like you are using 2 different scripts try something like this.
Code:
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
        doSendMagicEffect(position, 32)
    end
    return true
end
 
Creaturescripts

fishing.lua
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local cmana = getCreatureMaxMana(cid)
if skill = SKILL_FISHING then
    setCreatureMaxMana(cid, cmana + (cmana * 0.01)) -- 0.01 = 1% (default)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_CONSOLE_BLUE, 'You have gained +1% maximum mana from fishing.')
end
doPlayerSave(cid, true)
return true
end

creaturescripts.xml
Code:
<event type="advance" name="Fishing" event="script" value="fishing.lua"/>

login.lua
Code:
doRegisterCreatureEvent(cid, "Fishing")
 
<!-- Uffox tiles -->
<movevent type="StepIn" itemid="4820" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4821" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4822" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4823" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4824" event="script" value="water.lua"/>
<movevent type="StepIn" itemid="4825" event="script" value="water.lua"/>
Code:
<movement type="StepIn" fromid="4820" toid="4825" event="script" value="water.lua"/>
 
Back
Top