Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.03 KB | None | 0 0
  1. --[[
  2. :::::::::::::::::::::::::::::::::::::
  3. ::: Script feita por Marshmello :::
  4. ::: Não remova os creditos Plase :::
  5. :::::::::::::::::::::::::::::::::::::
  6. ]]
  7.  
  8. local keywordHandler = KeywordHandler:new()
  9. local npcHandler = NpcHandler:new(keywordHandler)
  10. NpcSystem.parseParameters(npcHandler)
  11. local talkState = {}
  12.  
  13. function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
  14. function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
  15. function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
  16. function onThink() npcHandler:onThink() end
  17.  
  18. spawnPlayr = {
  19. playerS1 = {x = 1079, y = 198, z = 8}, --Lugar onde o player1 vai spawn
  20. playerS2 = {x = 1057, y = 198, z = 8}, --Lugar onde o player2 vai spawn
  21. playerS3 = {x = 1057, y = 218, z = 8}, --Lugar onde o player2 vai spawn
  22. playerS4 = {x = 1079, y = 218, z = 8},--Lugar onde o player3 vai spawn
  23. }
  24.  
  25. global = {
  26. playerS1 = 14721,
  27. playerS2 = 14722,
  28. playerS3 = 14723,
  29. playerS4 = 14722,
  30. }
  31.  
  32. globalName = {
  33. playerS1 = 14731,
  34. playerS2 = 14732,
  35. playerS3 = 14733,
  36. playerS4 = 14732,
  37. }
  38.  
  39. local function puxarPlayers()
  40.  
  41. puxar1 = getCreatureByName(getGlobalStorageValue(globalName.playerS1))
  42. puxar2 = getCreatureByName(getGlobalStorageValue(globalName.playerS2))
  43. puxar3 = getCreatureByName(getGlobalStorageValue(globalName.playerS3))
  44. puxar4 = getCreatureByName(getGlobalStorageValue(globalName.playerS4))
  45. doTeleportThing(puxar1, spawnPlayr.playerS1)
  46. doTeleportThing(puxar2, spawnPlayr.playerS2)
  47. doTeleportThing(puxar3, spawnPlayr.playerS3)
  48. doTeleportThing(puxar4, spawnPlayr.playerS4)
  49.  
  50. Bombermon.resetPlayerConfigs(puxar1)
  51. Bombermon.resetPlayerConfigs(puxar2)
  52. Bombermon.resetPlayerConfigs(puxar3)
  53. Bombermon.resetPlayerConfigs(puxar4)
  54. Bombermon.resetArea()
  55. setGlobalStorageValue(global.playerS1, -1)
  56. setGlobalStorageValue(global.playerS2, -1)
  57. setGlobalStorageValue(global.playerS3, -1)
  58. setGlobalStorageValue(global.playerS4, -1)
  59. setPlayerStorageValue(puxar1, 14731,-1)
  60. setPlayerStorageValue(puxar2, 14731,-1)
  61. setPlayerStorageValue(puxar3, 14731,-1)
  62. setPlayerStorageValue(puxar4, 14731,-1)
  63.  
  64. setPlayerStorageValue(puxar1, 77947, 1)
  65. setPlayerStorageValue(puxar2, 77947, 1)
  66. setPlayerStorageValue(puxar3, 77947, 1)
  67. setPlayerStorageValue(puxar4, 77947, 1)
  68.  
  69. doPlayerSendTextMessage(puxar1, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  70. doPlayerSendTextMessage(puxar2, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  71. doPlayerSendTextMessage(puxar3, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  72. doPlayerSendTextMessage(puxar4, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  73.  
  74.  
  75.  
  76. end
  77.  
  78. function creatureSayCallback(cid, type, msg)
  79.  
  80. if(not npcHandler:isFocused(cid)) then
  81. return false
  82. end
  83.  
  84.  
  85.  
  86.  
  87. if msgcontains(msg, 'sim') then
  88. local areaBomb = {fromx = 1057, fromy = 198, fromz = 8, tox = 1079, toy = 218, toz = 8}
  89. local storage = 72821168
  90.  
  91.  
  92. -- if getPlayerStorageValue(cid, storage) == 0 then
  93.  
  94. -- selfSay('Você precisa está logado no new client para jogar o bombermon', cid)
  95. -- sendDialogNpc(cid, getNpcCid(),'Você precisa está logado no new client para jogar o bombermon')
  96.  
  97. -- return true
  98. -- end
  99.  
  100.  
  101. if #getPlayersInArea(areaBomb) > 0 then
  102. selfSay('Você precisa esperar acabar uma rodada para entrar no bombermon', cid)
  103. sendDialogNpc(cid, getNpcCid(),'Você precisa esperar acabar uma rodada para entrar no bombermon')
  104. return true
  105. end
  106.  
  107. if getPlayerStorageValue(cid,14731 ) > 0 then
  108. selfSay('Você já está na fila, por favor aguarde', cid)
  109. sendDialogNpc(cid, getNpcCid(),'Você já está na fila, por favor aguarde', cid)
  110. return true
  111. end
  112.  
  113.  
  114. if getGlobalStorageValue(global.playerS1) == -1 and getGlobalStorageValue(global.playerS2) == -1 getGlobalStorageValue(global.player3) == -1 and getGlobalStorageValue(global.player4) == -1 then
  115.  
  116.  
  117. selfSay('Você entrou na fila de espera, Aguarde os outros jogadores para iniciar', cid)
  118. sendDialogNpc(cid, getNpcCid(),'Você entrou na fila de espera, Aguarde os outros jogadores para iniciar')
  119. setGlobalStorageValue(globalName.playerS1, getPlayerName(cid))
  120. setGlobalStorageValue(global.playerS1, 1)
  121. setPlayerStorageValue(cid, 14731,1)
  122.  
  123.  
  124. elseif getGlobalStorageValue(global.playerS1) == 1 and getGlobalStorageValue(global.playerS2) == -1 getGlobalStorageValue(global.player3) == -1 and getGlobalStorageValue(global.player4) == -1 then
  125.  
  126. selfSay('Você entrou na fila de espera, Aguarde os outros jogadores para iniciar', cid)
  127. sendDialogNpc(cid, getNpcCid(),'Você entrou na fila de espera, Aguarde os outros jogadores para iniciar')
  128. setGlobalStorageValue(globalName.playerS2, getPlayerName(cid))
  129. setGlobalStorageValue(global.playerS2, 1)
  130. setPlayerStorageValue(cid, 14731,1)
  131.  
  132. elseif getGlobalStorageValue(global.playerS1) == 1 and getGlobalStorageValue(global.playerS2) == 1 and getGlobalStorageValue(global.player3) == -1 and getGlobalStorageValue(global.player4) == -1 then
  133.  
  134. selfSay('Você entrou na fila de espera, Aguarde os outros jogadores para iniciar', cid)
  135. sendDialogNpc(cid, getNpcCid(),'Você entrou na fila de espera, Aguarde os outros jogadores para iniciar')
  136. setGlobalStorageValue(globalName.playerS3, getPlayerName(cid))
  137. setGlobalStorageValue(global.playerS3, 1)
  138. setPlayerStorageValue(cid, 14731,1)
  139.  
  140.  
  141.  
  142. elseif getGlobalStorageValue(global.playerS1) == 1 and getGlobalStorageValue(global.playerS2) == 1 and getGlobalStorageValue(global.player3) == 1 and getGlobalStorageValue(global.player4) == -1 then
  143.  
  144. selfSay('Pronto Você entrou na fila, o game irar começar em 5 segundos', cid)
  145. sendDialogNpc(cid, getNpcCid(),'Pronto Você entrou na fila, o game irar começar em 5 segundos')
  146. setGlobalStorageValue(globalName.playerS4, getPlayerName(cid))
  147. setGlobalStorageValue(global.playerS4, 1)
  148. setPlayerStorageValue(cid, 14731,1)
  149. addEvent(function()
  150. puxarPlayers()
  151. end, 5*1000)
  152.  
  153.  
  154. end
  155.  
  156.  
  157. end
  158.  
  159. return true
  160.  
  161. end
  162.  
  163.  
  164. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  165. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement