Geavin

Chat spam tafuta kazi

Nov 4th, 2026
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local lp = Players.LocalPlayer
  4.  
  5. -- pick the right chat service depending on game version
  6. local TextChatService = game:GetService("TextChatService")
  7. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  8.  
  9. local MESSAGE = "Tafuta kazi"
  10. local DELAY = 0.15 -- seconds between sends; raise this if you get rate-limited
  11.  
  12. -- modern chat (TextChatService)
  13. local function sendModern()
  14. local channels = TextChatService:FindFirstChild("TextChannels")
  15. if not channels then return false end
  16. local general = channels:FindFirstChild("RBXGeneral")
  17. if not general then return false end
  18. general:SendAsync(MESSAGE)
  19. return true
  20. end
  21.  
  22. -- legacy chat fallback (older games using say message remote)
  23. local function sendLegacy()
  24. local chatEvents = ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
  25. if not chatEvents then return false end
  26. local sayMessage = chatEvents:FindFirstChild("SayMessageRequest")
  27. if not sayMessage then return false end
  28. sayMessage:FireServer(MESSAGE, "All")
  29. return true
  30. end
  31.  
  32. -- pick which path to use once
  33. local useModern = TextChatService.ChatVersion == Enum.ChatVersion.TextChatService
  34.  
  35. -- core loop — runs until the script is killed (leaving the server kills it)
  36. task.spawn(function()
  37. while true do
  38. local ok = false
  39. if useModern then
  40. ok = sendModern()
  41. if not ok then ok = sendLegacy() end
  42. else
  43. ok = sendLegacy()
  44. if not ok then ok = sendModern() end
  45. end
  46. if not ok then
  47. -- neither chat system found; wait a beat and retry
  48. task.wait(0.5)
  49. else
  50. task.wait(DELAY)
  51. end
  52. end
  53. end)
Advertisement
Add Comment
Please, Sign In to add comment