• 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 Skill scroll error

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hello!

I need help with this script. Its a skill scroll, but im getting this error, i dont know how to fix it cuz im not a scripter.. :/

Code:
[Error - LuaScriptInterface::loadFile] data/actions/scripts/swordscroll.lua:2: '
)' expected near '='
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/swordscro
ll.lua)
data/actions/scripts/swordscroll.lua:2: ')' expected near '='

<script>

Lua:
function onUse(cid, item, fromPosition)
doPlayerAddSkill(cid, axe, amount = 1) -- You can change axe to w/e
end
return true
end
 
Use the correct compare operator:
Lua:
==

Okay now im getting this error

Code:
[Error - Action Interface]
data/actions/scripts/swordscroll.lua:onUse
Description:
data/lib/050-function.lua:368: 'for' limit must be a number
stack traceback:
        data/lib/050-function.lua:368: in function 'doPlayerAddSkill'
        data/actions/scripts/swordscroll.lua:2: in function <data/actions/script
s/swordscroll.lua:1>
 
I used it and advanced from axe fighting 10 to 27 :S!?

Lua:
--Upgrade skills for 0.4 by Qanti
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local reqTries = getPlayerRequiredSkillTries
   
  if item.itemid == YOURIDHERE then

      doPlayerAddSkill(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 1))
      doSendMagicEffect(toPosition, 30)
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your axe skill has been incremented by [+1].")
else
      doSendMagicEffect(toPosition, 2)
      doPlayerSendTextMessage(cid, 22, "Sorry, you cant use it!.")
  end
  return true
end
 
Last edited by a moderator:
Lua:
--Upgrade skills for 0.3.6 by Qanti
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local goSkills = getPlayerStorageValue(cid, 787878)
   
  if item.itemid == YOURIDHERE then

      doPlayerAddSkill(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 1))
      doSendMagicEffect(toPosition, 30)
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your axe skill has been incremented by [+1].")
else
      doSendMagicEffect(toPosition, 2)
      doPlayerSendTextMessage(cid, 22, "Sorry, you cant use it!.")
  end
  return true
end

Damn, this error appears:

Code:
[Error - Action Interface]
data/actions/scripts/swordscroll.lua:onUse
Description:
data/actions/scripts/swordscroll.lua:7: attempt to call global 'reqTries' (a nil
 value)
stack traceback:
        data/actions/scripts/swordscroll.lua:7: in function <data/actions/script
s/swordscroll.lua:2>
 
Damn, this error appears:

Code:
[Error - Action Interface]
data/actions/scripts/swordscroll.lua:onUse
Description:
data/actions/scripts/swordscroll.lua:7: attempt to call global 'reqTries' (a nil
 value)
stack traceback:
        data/actions/scripts/swordscroll.lua:7: in function <data/actions/script
s/swordscroll.lua:2>

Lua:
--Upgrade skills for 0.4 by Qanti
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local reqTries = getPlayerRequiredSkillTries
   
  if item.itemid == YOURIDHERE then

      doPlayerAddSkill(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 1))
      doSendMagicEffect(toPosition, 30)
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your axe skill has been incremented by [+1].")
else
      doSendMagicEffect(toPosition, 2)
      doPlayerSendTextMessage(cid, 22, "Sorry, you cant use it!.")
  end
  return true
end
 
Last edited by a moderator:
Lua:
--Upgrade skills for 0.3.6 by Qanti
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local reqTries = getPlayerRequiredSkillTries
   
  if item.itemid == YOURIDHERE then

      doPlayerAddSkill(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 1))
      doSendMagicEffect(toPosition, 30)
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your axe skill has been incremented by [+1].")
else
      doSendMagicEffect(toPosition, 2)
      doPlayerSendTextMessage(cid, 22, "Sorry, you cant use it!.")
  end
  return true
end

Seriosly, still adds to much levels. Look :S

Code:
15:29 You advanced in axe fighting [11].
15:29 You advanced in axe fighting [12].
15:29 You advanced in axe fighting [13].
15:29 You advanced in axe fighting [14].
15:29 You advanced in axe fighting [15].
15:29 You advanced in axe fighting [16].
15:29 You advanced in axe fighting [17].
15:29 You advanced in axe fighting [18].
15:29 You advanced in axe fighting [19].
15:29 You advanced in axe fighting [20].
15:29 You advanced in axe fighting [21].
15:29 You advanced in axe fighting [22].
15:29 You advanced in axe fighting [23].
15:29 You advanced in axe fighting [24].
15:29 You advanced in axe fighting [25].
15:29 You advanced in axe fighting [26].
15:29 You advanced in axe fighting [27].
15:29 You advanced in axe fighting [28].
15:29 You advanced in axe fighting [29].
15:29 You advanced in axe fighting [30].
15:29 You advanced in axe fighting [31].
15:29 You advanced in axe fighting [32].
15:29 You advanced in axe fighting [33].
15:29 You advanced in axe fighting [34].
15:29 You advanced in axe fighting [35].
15:29 You advanced in axe fighting [36].
15:29 You advanced in axe fighting [37].
15:29 You advanced in axe fighting [38].
15:29 You advanced in axe fighting [39].
15:29 You advanced in axe fighting [40].
15:29 You advanced in axe fighting [41].
15:29 You advanced in axe fighting [42].
15:29 You advanced in axe fighting [43].
15:29 You advanced in axe fighting [44].
15:29 You advanced in axe fighting [45].
15:29 You advanced in axe fighting [46].
15:29 You advanced in axe fighting [47].
15:29 You advanced in axe fighting [48].
15:29 You advanced in axe fighting [49].
15:29 You advanced in axe fighting [50].
15:29 You advanced in axe fighting [51].
15:29 You advanced in axe fighting [52].
15:29 You advanced in axe fighting [53].
15:29 You advanced in axe fighting [54].
15:29 You advanced in axe fighting [55].
15:29 You advanced in axe fighting [56].
15:29 You advanced in axe fighting [57].
15:29 You advanced in axe fighting [58].
15:29 You advanced in axe fighting [59].
15:29 You advanced in axe fighting [60].
15:29 You advanced in axe fighting [61].
15:29 You advanced in axe fighting [62].
15:29 You advanced in axe fighting [63].
15:29 You advanced in axe fighting [64].
15:29 You advanced in axe fighting [65].
15:29 You advanced in axe fighting [66].
15:29 You advanced in axe fighting [67].
15:29 You advanced in axe fighting [68].
15:29 You advanced in axe fighting [69].
15:29 You advanced in axe fighting [70].
15:29 You advanced in axe fighting [71].
15:29 You advanced in axe fighting [72].
15:29 You advanced in axe fighting [73].
15:29 You advanced in axe fighting [74].
15:29 You advanced in axe fighting [75].
15:29 You advanced in axe fighting [76].
15:29 You advanced in axe fighting [77].
15:29 You advanced in axe fighting [78].
15:29 You advanced in axe fighting [79].
15:29 You advanced in axe fighting [80].
15:29 You advanced in axe fighting [81].
15:29 You advanced in axe fighting [82].
15:29 You advanced in axe fighting [83].
15:29 You advanced in axe fighting [84].
15:29 You advanced in axe fighting [85].
15:29 You advanced in axe fighting [86].
15:29 You advanced in axe fighting [87].
15:29 You advanced in axe fighting [88].
15:29 You advanced in axe fighting [89].
15:29 You advanced in axe fighting [90].
15:29 You advanced in axe fighting [91].
15:29 You advanced in axe fighting [92].
15:29 You advanced in axe fighting [93].
15:29 You advanced in axe fighting [94].
15:29 You advanced in axe fighting [95].
15:29 You advanced in axe fighting [96].
15:29 You advanced in axe fighting [97].
15:29 You advanced in axe fighting [98].
15:29 You advanced in axe fighting [99].
15:29 You advanced in axe fighting [100].
15:29 You advanced in axe fighting [101].
15:29 You advanced in axe fighting [102].
15:29 You advanced in axe fighting [103].
15:29 You advanced in axe fighting [104].
15:29 You advanced in axe fighting [105].
15:29 You advanced in axe fighting [106].
15:29 You advanced in axe fighting [107].

Thats one click. :/
 
Back
Top Bottom