florian2833z

spam.lua

Oct 7th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. --[[
  2. Credits: tjackiseN/r0z@steam (C) 2014
  3. Check out; tjackiseN.blogspot.se
  4.  
  5. Note: This script was made for TTT and sandbox. Won't work on any other gamemodes.
  6. But if you really want me to fix that so send an email about it. ([email protected])
  7.  
  8. :: Retard Notice ::
  9. For those who can't read the code:
  10. Set spam_enabled to 1 to start, and 0 to disable.
  11. Set spam_message to the message you want to spam.
  12. --]]
  13.  
  14. local spamCvar = CreateClientConVar( "spam_enabled", 0, true, false )
  15. local spamMessageCvar = CreateClientConVar( "spam_message", "www.tjackiseN.blogspot.se", true, false )
  16. local spamMsg = spamMessageCvar:GetString()
  17.  
  18. local spam = function()
  19.  
  20. if (spamCvar:GetInt() == 1 and gamemode.Get("terrortown")) then
  21. if(LocalPlayer():Alive() and LocalPlayer():Team() != 1002) then
  22. spamMsg = spamMessageCvar:GetString()
  23. RunConsoleCommand("say", spamMsg)
  24. else
  25. pamMsg = spamMessageCvar:GetString()
  26. RunConsoleCommand("say_team", spamMsg)
  27. end
  28. end
  29. if (spamCvar:GetInt() == 1 and gamemode.Get("sandbox")) then
  30. spamMsg = spamMessageCvar:GetString()
  31. RunConsoleCommand("say", spamMsg)
  32. end
  33. end
  34.  
  35. chat.AddText(Color(255,69,0,255), "[tjackiseN] Spammer successfully loaded.")
  36. chat.AddText(Color(255,69,0,255), "Change 'spam_message' and 'spam_enabled' in the console.")
  37.  
  38. hook.Add("Think", "spam", spam)
Add Comment
Please, Sign In to add comment