Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.83 KB | None | 0 0
  1. --Credits
  2. --[[
  3. Henslock
  4. Kibblebit
  5. Grandelf1
  6. ]]--
  7.  
  8. --[[Tables]]--
  9. ChatCoolDowns = {}
  10. LevelCoolDown = {}
  11.  
  12. --Command to use chat
  13. local msg = "#c" --Command use to talk.
  14.  
  15. --Command to find other commands
  16. local cmd = "#cmd" -- Command used to show all other commands.
  17.  
  18. --Player Editing Commands
  19. local pot = "#potions" -- Command to recieve a player defined amount of potions.
  20. local goldmsg = "#gold" -- Command to give the player a certain ammount of gold.
  21. local buffs = "#buffs" -- Command to give the player a full set of level 80 buffs.
  22. local save = "#save" -- Command to save the players character.
  23. local gender = "#gender" -- Command to change your gender.
  24. local mount = "#mount" --Command to set a players mount Id.
  25. local dismount = "#dismount" -- Dismount from mount.
  26. local play = "#play" -- Plays sound id defined by player.
  27. local speed = "#speed" -- Sets the speed of a player.
  28. local morph = "#morph" -- Sets the display of a player.
  29. local demorph = "#demorph" -- Removes the display of a player.
  30. local color = "#color" -- Shows you what ranks are what colors.
  31. local heal = "#heal" -- Restores your health to full(Must be out of combat)
  32. local revive = "#revive" -- Revives your self.
  33. local level ="#level" -- Gives one free level every 86,400 seconds(1 day).
  34.  
  35. --Player Info Commands
  36. local arena = "#arena" -- Displays players total arena points.
  37. local honor = "#honor" -- Displays players total honor.
  38.  
  39. --Title Configs
  40. local tag = "World" -- Tag to show before user rank.
  41.  
  42. --Value Configs
  43. local goldamount = "1000000" -- Amount of gold to give players ( defined in copper )
  44. local pot2 = 40070 -- Id of the potion the player shall recieve from #potions.
  45.  
  46. --Anti-Spam(added by henslock)--
  47. local antispam = true -- True = on False = off
  48. local antispamtimer = 1.5 -- Amount of time ( In seconds )
  49.  
  50. --Do Not Touch--
  51.  
  52. function ChatCoolDowns.worldchat (event, player, message, type, language)
  53.     if (message:find(msg.." ")) then
  54.         local text = message:gsub(msg.." ", "")
  55.             if(antispam==true) and (ChatCoolDowns[player:GetName()]~=nil) and ((os.clock()-ChatCoolDowns[player:GetName()]))<=antispamtimer then
  56.                 player:SendBroadcastMessage("|cFF00CC99["..tag.."]|r |cFFFF99CC[Spam Filter]|r |cFF00CCFFPlease do not spam the world chat|r")
  57.         else
  58.                 ChatCoolDowns[player:GetName()] = os.clock()
  59.                     for _, v in pairs(GetPlayersInWorld()) do
  60.                     local rank = player:GetGmRank()
  61.             if (player:IsGm()==true) and (rank == 'az') then
  62.                 v:SendBroadcastMessage("|cFF00CC99["..tag.."]|r |cFF99CC00["..player:GetName().."]:|r |cFFFFFF99"..text.."|r")
  63.             elseif (player:IsGm()==true) and (rank == 'a') then
  64.                 v:SendBroadcastMessage("|cFF00CC99["..tag.."]|r |cFF333300["..player:GetName().."]:|r |cFFFFFF99"..text.."|r")
  65.             elseif (player:IsGm()==true) and (rank == '3') then
  66.                 v:SendBroadcastMessage("|cFF00CC99["..tag.."]|r |cFFCC0099["..player:GetName().."]:|r |cFFFFFF99"..text.."|r")
  67.             elseif (player:IsGm()==true) and (rank == 'donator') then
  68.                 v:SendBroadcastsMessage("|cFF00CC99["..tag.."]|r |cFF9900FF["..player:GetName().."]:|r |cFFFFFF99"..text.."|r")
  69.             elseif (player:IsGm()==false) and (player:GetTeam() == 0) then
  70.                 v:SendBroadcastMessage("|cFF00CC99["..tag.."]|r |cFF3399FF["..player:GetName().."]:|r |cFFFFFF99"..text.."|r")
  71.             elseif (player:IsGm()==false) and (player:GetTeam() == 1) then
  72.                 v:SendBroadcastMessage("|cFF00CC99["..tag.."]|r |cFFFF3300["..player:GetName().."]:|r |cFFFFFF99"..text.."|r")
  73.                 end
  74.                     end
  75.                         end
  76.                             return 0
  77.                                 end                        
  78.     if (message == cmd) then
  79.             if (player:GetGmRank() == 'donator') then
  80.         player:SendBroadcastMessage("World Chat Commands")
  81.         player:SendBroadcastMessage(""..msg.."  Sends message to world")
  82.         player:SendBroadcastMessage(""..pot.."  Gives you a set of potions")
  83.         player:SendBroadcastMessage(""..goldmsg.."  Gives you 100 gold.")
  84.         player:SendBroadcastMessage(""..buffs.."  Gives you a set of buffs.")
  85.         player:SendBroadcastMessage(""..save.."  Saves your character instantly.")
  86.         player:SendBroadcastMessage(""..gender.."  Changes your players sex.")
  87.         player:SendBroadcastMessage(""..mount.."  Makes you mount any mount you want.")
  88.         player:SendBroadcastMessage(""..dismount.."  Dismounts any mount your on.")
  89.         player:SendBroadcastMessage(""..play.."  Play any sound id defined by the player.")
  90.         player:SendBroadcastMessage(""..speed.."  Set your speed up to the max value of 15.")
  91.         player:SendBroadcastMessage(""..morph.."  Sets your display to whatever.")
  92.         player:SendBroadcastMessage(""..demorph.."  Removes your display.")
  93.         player:SendBroadcastMessage(""..heal.." Heals you to full health.")
  94.  
  95.         return 0
  96.             elseif (player:GetGmRank() == 'az'  or player:GetGmRank() == 'a' or player:GetGmRank() == '3') then
  97.         player:SendBroadcastMessage("World Chat Commands")
  98.         player:SendBroadcastMessage(""..msg.."  Sends message to world")
  99.         player:SendBroadcastMessage(""..pot.."  Gives you a set of potions")
  100.         player:SendBroadcastMessage(""..goldmsg.."  Gives you 100 gold.")
  101.         player:SendBroadcastMessage(""..buffs.."  Gives you a set of buffs.")
  102.         player:SendBroadcastMessage(""..save.."  Saves your character instantly.")
  103.         player:SendBroadcastMessage(""..gender.."  Changes your players sex.")
  104.         player:SendBroadcastMessage(""..mount.."  Makes you mount any mount you want.")
  105.         player:SendBroadcastMessage(""..dismount.."  Dismounts any mount your on.")
  106.         player:SendBroadcastMessage(""..play.."  Play any sound id defined by the player.")
  107.         player:SendBroadcastMessage(""..speed.."  Set your speed up to the max value of 15.")
  108.         player:SendBroadcastMessage(""..morph.."  Sets your display to whatever.")
  109.         player:SendBroadcastMessage(""..demorph.."  Removes your display.")
  110.         player:SendBroadcastMessage(""..heal.." Heals you to full health.")
  111.  
  112.         return 0
  113.             else
  114.         player:SendBroadcastMessage("World Chat Commands")
  115.         player:SendBroadcastMessage(""..msg.."  Sends message to world")
  116.         player:SendBroadcastMessage(""..buffs.."  Gives you a set of buffs.")
  117.         player:SendBroadcastMessage(""..save.."  Saves your character instantly.")
  118.         player:SendBroadcastMessage(""..play.."  Play any sound id defined by the player.")
  119.         return 0
  120.         end
  121.     end
  122.  
  123. ----------------------------------------Gold
  124.  
  125.     if (player:GetGmRank() == '0') then
  126.         player:SendBroadcastMessage("You do not have permission to use this command!")
  127.         else
  128.     if (message == goldmsg) then
  129.             player:DealGoldMerit(goldamount)
  130.         return 0
  131.     end
  132. end
  133.  
  134. ----------------------------------------Buffs
  135.  
  136.     if (message == buffs) then
  137.         if (player:IsInCombat() == false) then
  138.         player:CastSpell(48161)
  139.         player:CastSpell(48073)
  140.         player:CastSpell(48469)
  141.         player:CastSpell(48451)
  142.         player:CastSpell(42995)
  143.                 return 0
  144.     else
  145.         player:SendBroadcastMessage("Get out of combat!")
  146.     end
  147. end
  148.  
  149. ----------------------------------------Save
  150.  
  151.     if (message == save) then
  152.         if (player:IsInCombat() == false) then
  153.             player:SavePlayer()
  154.             player:SendBroadcastMessage("You are now saved!")
  155.             return 0
  156.         else
  157.             player:SendBroadcastMessage("Get out of combat!")
  158.         end
  159.     end
  160.  
  161. ----------------------------------------Potions
  162.  
  163. local msg = message:lower()
  164. local msg, ctmsg = string.find(message, "#potion")
  165.     if (player:GetGmRank() == '0') then
  166.         player:SendBroadcastMessage("You do not have permission to use this command!")
  167.         else
  168.     if(msg == 1) then
  169.         local text = message:gsub("#potion", "")
  170.         player:AddItem(pot2, text)
  171.         return 0
  172.     end
  173. end
  174.    
  175. ----------------------------------------Gender
  176.  
  177. local msg = message:lower()
  178. local msg, ctmsg = string.find(message, "#gender")
  179.     if (player:GetGmRank() == '0') then
  180.         player:SendBroadcastMessage("You do not have permission to use this command!")
  181.         else
  182.             if(msg == 1) then
  183.         local text = message:gsub("#gender", "")
  184.             if(text == " 0") then
  185.         player:SendBroadcastMessage("Gender set to Male. Please re-log for it to take effect.")
  186.         player:SetGender(text)
  187.         return 0;
  188.             elseif(text == " 1") then
  189.         player:SendBroadcastMessage("Gender set to Female. Please re-log for it to take effect.")
  190.         player:SetGender(text)
  191.         return 0;
  192.             elseif(text ~= " 0" and text ~= " 1") then
  193.         player:SendBroadcastMessage("Good job your now Micheal Jackson")
  194.         return 0;
  195.     end
  196. end
  197. end
  198.    
  199. -----------------------------------------Mounts
  200.    
  201. local msg = message:lower()
  202. local msg, ctmsg = string.find(message, "#mount")
  203.     if (player:GetGmRank() == '0') then
  204.         player:SendBroadcastMessage("You do not have permission to use this command!")
  205.         else
  206.     if(msg == 1) then
  207.         local text = message:gsub("#mount", "")
  208.             player:SetMount(text)
  209.             return 0;
  210.         end
  211.     if(message == dismount) then
  212.     player:Dismount()
  213. end
  214. end
  215.  
  216. ------------------------------------------Sound
  217. local msg = message:lower()
  218. local msg, ctmsg = string.find(message, "#play")
  219.     if(msg == 1) then
  220.         local text = message:gsub("#play", "")
  221.             player:PlaySoundToPlayer(text)
  222.             return 0;
  223.         end
  224. ------------------------------------------Speed
  225. local msg = message:lower()
  226. local msg, ctmsg = string.find(message, "#speed")
  227.     if (player:GetGmRank() == '0') then
  228.         player:SendBroadcastMessage("You do not have permission to use this command!")
  229.         else
  230.     if(msg == 1) then
  231.         local text = message:gsub("#speed", "")
  232.             player:SetPlayerSpeed(text)
  233.             return 0;
  234.         else
  235.             if(text > 25) then
  236.             player:SetPlayerSpeed(25)
  237.         end
  238.         end
  239.         end
  240.  
  241. ------------------------------------------Morph
  242. local msg = message:lower()
  243. local msg, ctmsg = string.find(message, "#morph")
  244.     if (player:GetGmRank() == '0') then
  245.         player:SendBroadcastMessage("You do not have permission to use this command!")
  246.         else
  247.     if(msg == 1) then
  248.         local text = message:gsub("#morph", "")
  249.             player:SetModel(text)
  250.             return 0;
  251.         end
  252.     end
  253.  
  254. ------------------------------------------DeMorph
  255.     if (player:GetGmRank() == '0') then
  256.         player:SendBroadcastMessage("You do not have permission to use this command!")
  257.         else
  258.     if (message == demorph) then
  259.         player:DeMorph()
  260.     end
  261. end
  262.  
  263. ------------------------------------------Color
  264.     if (message == color) then
  265.     player:SendBroadcastMessage("Red -- Horde")
  266.     player:SendBroadcastMessage("Blue -- Alliance")
  267.     player:SendBroadcastMessage("Green -- Admin")
  268.     player:SendBroadcastMessage("Purple -- Donator")
  269.     player:SendBroadcastMessage("Dark Green -- Developer")
  270.     player:SendBroadcastMessage("Pink -- Gamemaster")
  271. end
  272. ------------------------------------------Healing
  273.     if (player:GetGmRank() == '0') then
  274.         player:SendBroadcastMessage("You do not have permission to use this command!")
  275.         else
  276.     if (message == heal) then
  277.         if (player:IsInCombat() == false) then
  278.     player:SetHealthPct(100)
  279.         else
  280.         player:SendBroadcastMessage("Get out of Combat!")
  281.             end
  282.         end
  283.     end
  284. ------------------------------------------Revive
  285.     if (player:GetGmRank() == '0') then
  286.         player:SendBroadcastMessage("You do not have permission to use this command!")
  287.         else
  288.     if (message == revive) then
  289.             if (player:IsDead() == true) then
  290.                 player:ResurrectPlayer()
  291.                 end
  292.             end
  293.         end
  294.        
  295. ------------------------------------------Arena Points
  296.  
  297.     if (message == arena) then
  298.         local pts = player:GetArenaPoints()
  299.         player:SendBroadcastMessage("Your total arena points is: "..pts.."")
  300.     end
  301.    
  302. -----------------------------------------Total Honor
  303.         if (message == honor) then
  304.             local hon = player::GetTotalHonor()
  305.             player:SendBroadcastMessage("Your total honor is: "..hon.."")
  306.         end
  307.        
  308. -------------------------------------------Level
  309.        
  310.         if (player:GetGmRank() == '0') then
  311.         player:SendBroadcastMessage("You do not have permission to use this command!")
  312.         elseif (message == level) then
  313.             if LevelCoolDown[player:GetName()] ~= nil and ((os.clock()-LevelCoolDown[player:GetName()])) <= 86400 then
  314.         player:SendBroadcastMessage("You may not obtain your free level for today!")
  315.         else
  316.         LevelCoolDown[player:GetName()] = os.clock()
  317.         local slvl = player:GetPlayerLevel()
  318.         player:SetLevel(slvl + 1)
  319.         end
  320.     end
  321. end
  322. RegisterServerHook(16, "ChatCoolDowns.worldchat")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement