Advertisement
Guest User

Untitled

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