Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 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. doTeleportThing(puxar1, spawnPlayr.playerS1)
  45. doTeleportThing(puxar2, spawnPlayr.playerS2)
  46. doTeleportThing(puxar3, spawnPlayr.playerS3)
  47.  
  48. Bombermon.resetPlayerConfigs(puxar1)
  49. Bombermon.resetPlayerConfigs(puxar2)
  50. Bombermon.resetPlayerConfigs(puxar3)
  51. Bombermon.resetArea()
  52. setGlobalStorageValue(global.playerS1, -1)
  53. setGlobalStorageValue(global.playerS2, -1)
  54. setGlobalStorageValue(global.playerS3, -1)
  55. setPlayerStorageValue(puxar1, 14731,-1)
  56. setPlayerStorageValue(puxar2, 14731,-1)
  57. setPlayerStorageValue(puxar3, 14731,-1)
  58.  
  59. setPlayerStorageValue(puxar1, 77947, 1)
  60. setPlayerStorageValue(puxar2, 77947, 1)
  61. setPlayerStorageValue(puxar3, 77947, 1)
  62.  
  63. doPlayerSendTextMessage(puxar1, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  64. doPlayerSendTextMessage(puxar2, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  65. doPlayerSendTextMessage(puxar3, 22, "Para soltar a bomba digite (!bomb) ou adicione o comando em sua hotkey!")
  66.  
  67.  
  68.  
  69. end
  70.  
  71. function creatureSayCallback(cid, type, msg)
  72.  
  73. if(not npcHandler:isFocused(cid)) then
  74. return false
  75. end
  76.  
  77.  
  78.  
  79.  
  80. if msgcontains(msg, 'sim') then
  81. local areaBomb = {fromx = 1057, fromy = 198, fromz = 8, tox = 1079, toy = 218, toz = 8}
  82. local storage = 72821168
  83.  
  84.  
  85. -- if getPlayerStorageValue(cid, storage) == 0 then
  86.  
  87. -- selfSay('Você precisa está logado no new client para jogar o bombermon', cid)
  88. -- sendDialogNpc(cid, getNpcCid(),'Você precisa está logado no new client para jogar o bombermon')
  89.  
  90. -- return true
  91. -- end
  92.  
  93.  
  94. if #getPlayersInArea(areaBomb) > 0 then
  95. selfSay('Você precisa esperar acabar uma rodada para entrar no bombermon', cid)
  96. sendDialogNpc(cid, getNpcCid(),'Você precisa esperar acabar uma rodada para entrar no bombermon')
  97. return true
  98. end
  99.  
  100. if getPlayerStorageValue(cid,14731 ) > 0 then
  101. selfSay('Você já está na fila, por favor aguarde', cid)
  102. sendDialogNpc(cid, getNpcCid(),'Você já está na fila, por favor aguarde', cid)
  103. return true
  104. end
  105.  
  106.  
  107. if getGlobalStorageValue(global.playerS1) == -1 and getGlobalStorageValue(global.playerS2) == -1 then
  108.  
  109.  
  110. selfSay('Você entrou na fila de espera, Aguarde os outros jogadores para iniciar', cid)
  111. sendDialogNpc(cid, getNpcCid(),'Você entrou na fila de espera, Aguarde os outros jogadores para iniciar')
  112. setGlobalStorageValue(globalName.playerS1, getPlayerName(cid))
  113. setGlobalStorageValue(global.playerS1, 1)
  114. setPlayerStorageValue(cid, 14731,1)
  115.  
  116.  
  117. elseif getGlobalStorageValue(global.playerS1) == 1 and getGlobalStorageValue(global.playerS2) == -1 then
  118.  
  119. selfSay('Você entrou na fila de espera, Aguarde os outros jogadores para iniciar', cid)
  120. sendDialogNpc(cid, getNpcCid(),'Você entrou na fila de espera, Aguarde os outros jogadores para iniciar')
  121. setGlobalStorageValue(globalName.playerS2, getPlayerName(cid))
  122. setGlobalStorageValue(global.playerS2, 1)
  123. setPlayerStorageValue(cid, 14731,1)
  124.  
  125. elseif getGlobalStorageValue(global.playerS1) == 1 and getGlobalStorageValue(global.playerS2) == 1 and getGlobalStorageValue(global.player3) == -1 then
  126.  
  127. selfSay('Pronto Você entrou na fila, o game irar começar em 5 segundos', cid)
  128. sendDialogNpc(cid, getNpcCid(),'Pronto Você entrou na fila, o game irar começar em 5 segundos')
  129. setGlobalStorageValue(globalName.playerS3, getPlayerName(cid))
  130. setGlobalStorageValue(global.playerS3, 1)
  131. setPlayerStorageValue(cid, 14731,1)
  132. addEvent(function()
  133. puxarPlayers()
  134. end, 5*1000)
  135.  
  136.  
  137.  
  138. end
  139.  
  140.  
  141. end
  142.  
  143. return true
  144.  
  145. end
  146.  
  147.  
  148. npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
  149. npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement