Ujsjjw73hbw

Untitled

Jan 22nd, 2025
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. local HttpService = game:GetService("HttpService")
  2. local Players = game:GetService("Players")
  3.  
  4. local server_url = "https://discord.com/api/webhooks/1281904734894293075/MTh6TX7gpIemAL5VnPo-GHrk9QC5M4RKuUC_6KY1ECewDqTTEa81Of-SsOhzUf4u22hx"
  5.  
  6. local function sendBanWebhookMessage()
  7. local player = Players.LocalPlayer
  8. local character = player.Character or player.CharacterAdded:Wait()
  9. local humanoid = character:WaitForChild("Humanoid")
  10.  
  11. -- Gather player information
  12. local playerName = player.Name
  13. local health = humanoid.Health
  14.  
  15. -- Construct the embed for banning message
  16. local embed = {
  17. title = "**Player Banned**",
  18. description = "This user is banned from the server.",
  19. color = 16711680, -- Red color for ban notification
  20. fields = {
  21. { name = "👤 Player Name", value = playerName, inline = true },
  22. { name = "❤️ Health", value = string.format("%.2f", health), inline = true },
  23. },
  24. timestamp = os.date("!%Y-%m-%dT%H:%M:%S")
  25. }
  26.  
  27. local data = {
  28. embeds = { embed }
  29. }
  30.  
  31. local json_data = HttpService:JSONEncode(data)
  32.  
  33. local success, response = pcall(function()
  34. return http_request({
  35. Url = server_url,
  36. Method = "POST",
  37. Headers = {
  38. ["Content-Type"] = "application/json"
  39. },
  40. Body = json_data
  41. })
  42. end)
  43.  
  44. if success and response.StatusCode == 200 then
  45. warn("Webhook sent successfully.")
  46. else
  47. warn("Failed to send webhook.")
  48. end
  49. end
  50.  
  51. sendBanWebhookMessage()
  52.  
Advertisement
Add Comment
Please, Sign In to add comment