doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
function onStepIn(cid, item, position, fromPosition)
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
return true
end
function onThink(interval, lastExecution)
for _, cid in ipairs(getPlayersOnline()) do
doCreatureAddMana(cid, getPlayerSkillLevel(cid, SKILL_FISHING) * 2, false)
end
return true
end
<globalevent name="manaregen" interval="1" event="script" value="manaregen.lua"/>
[30/12/2014 01:42:55] [Error - LuaScriptInterface::loadFile] data/globalevents/scripts/manaregen.lua:4: ')' expected (to close '(' at line 3) near 'end'
[30/12/2014 01:42:55] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/manaregen.lua)
[30/12/2014 01:42:55] data/globalevents/scripts/manaregen.lua:4: ')' expected (to close '(' at line 3) near 'end'
doPlayerAddSkillTry(cid, SKILL_CLUB, 1)
if getPlayerSkillLevel(cid, SKILL_FISHING) >= 100 then
doPlayerSetRate(cid, SKILL_FISHING, 0)
end
function onThink(interval, lastExecution)
for _, cid in ipairs(getPlayersOnline()) do
doPlayerAddMana(cid, getPlayerSkillLevel(cid, SKILL_FISHING) * 2, false)
doPlayerAddHealth(cid, getPlayerSkillLevel(cid, SKILL_CLUB) * 0.5, false)
end
return true
end
[30/12/2014 02:44:27] data/globalevents/scripts/manaregen.lua:4: attempt to call global 'doPlayerAddHealth' (a nil value)
[30/12/2014 02:44:27] stack traceback:
[30/12/2014 02:44:27] data/globalevents/scripts/manaregen.lua:4: in function <data/globalevents/scripts/manaregen.lua:1>
[30/12/2014 02:44:27] [Error - GlobalEvents::think] Couldn't execute event: manaregen
function onThink(interval, lastExecution)
for _, cid in ipairs(getPlayersOnline()) do
doPlayerAddMana(cid, getPlayerSkillLevel(cid, SKILL_FISHING) * 2, false)
doCreatureAddHealth(cid, getPlayerSkillLevel(cid, SKILL_CLUB) * 0.5)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local food = FOODS[item.itemid]
if(not food) then
return false
end
if((getPlayerFood(cid) + food[1]) >= 400) then
doPlayerSendCancel(cid, "You are full.")
return true
end
doPlayerFeed(cid, food[1] * 4)
doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
doPlayerAddSkillTry(cid, SKILL_CLUB, 2)
doRemoveItem(item.uid, 1)
return true
end