Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. -- Square Skill Trainer made by Arthur aka artofwork
  2. -- This script will train all of a players skills indefintely
  3. -- It has a small configuration setup where you can set the number of tries per skill
  4. -- The time internveral in between each skill try added
  5. -- A storage value to help prevent abuse
  6. -- This is truely my first script, it comes without support since lua is new to me
  7. -- You can assign any tile you wish to this script that a player can walk on with action id 900
  8.  
  9.  
  10. -- Config --
  11. local storage = 18010 -- Storage value for the player when he steps on and off the tile
  12.  
  13. local skilltries = 1 -- Number of tries per skill
  14. local t = 4 * 1000 -- Set the time before try is added to skills
  15.  
  16. -------------------------------------------------------------------------
  17. function trainerthree(p)
  18. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  19. if p.item.actionid == 900 then
  20. doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 30 seconds")
  21. addEvent(trainertwo, 10 * 1000, p)
  22. end
  23. end
  24. return FALSE
  25. end
  26. function trainertwo(p)
  27. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  28. if p.item.actionid == 900 then
  29. doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 20 seconds")
  30. addEvent(trainerone, 10 * 1000, p)
  31. end
  32. end
  33. return FALSE
  34. end
  35. function trainerone(p)
  36. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  37. if p.item.actionid == 900 then
  38. doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 10 seconds")
  39. addEvent(readyToTrain, 10 * 1000, p)
  40. end
  41. end
  42. return FALSE
  43. end
  44.  
  45.  
  46.  
  47. function readyToTrain(p)
  48. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  49. if p.item.actionid == 900 then
  50. doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
  51. addEvent(trainMeA, t, p)
  52. end
  53. end
  54. return FALSE
  55. end
  56.  
  57.  
  58. function trainMeA(p)
  59. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  60. if p.item.actionid == 900 then
  61.  
  62. for a = 1, t do
  63. if(a == t) then
  64. doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
  65. doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
  66. doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
  67. doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
  68. doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
  69. doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
  70. end
  71. end
  72. end
  73. addEvent(trainMeB, t, p)
  74. end
  75. return FALSE
  76. end
  77.  
  78. function trainMeB(p)
  79. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  80. if p.item.actionid == 900 then
  81. for b = 1, t do
  82. if(b == t) then
  83. doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
  84. doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
  85. doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
  86. doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
  87. doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
  88. doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
  89. doCreatureAddMana(p.cid, 500)
  90. end
  91. end
  92. end
  93. addEvent(trainMeA, t, p)
  94. end
  95. return FALSE
  96. end
  97.  
  98.  
  99.  
  100. function onStepIn(cid, item)
  101. local p = {cid = cid, item = item, pos = pos}
  102. setPlayerStorageValue(p.cid, 18010, 1)
  103. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  104. if p.item.actionid == 900 then
  105. addEvent(trainerthree, 1 * 1000, p)
  106. end
  107. end
  108. return FALSE
  109. end
  110.  
  111.  
  112. function onStepOut(cid, item)
  113. getPlayerStorageValue(cid, 18010)
  114. setPlayerStorageValue(cid, 18010, 0)
  115. doPlayerSendTextMessage(cid,22,"Your training session has now ended")
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement