-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShieldScript.lua
More file actions
64 lines (54 loc) · 1.97 KB
/
Copy pathShieldScript.lua
File metadata and controls
64 lines (54 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- Shield by Technified
-- Replace YOUR_API_KEY_HERE with your actual API key
-- Optional: Add your Discord webhook URL for notifications
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local API_KEY = "YOUR_API_KEY_HERE"
local SHIELD_URL = "https://your-shield-domain.com/api/check"
local WEBHOOK_URL = "" -- Leave empty to disable notifications
local function sendWebhook(player, reason)
if WEBHOOK_URL == "" then return end
pcall(function()
HttpService:RequestAsync({
Url = WEBHOOK_URL,
Method = "POST",
Headers = { ["Content-Type"] = "application/json" },
Body = HttpService:JSONEncode({
embeds = {{
title = "Player Kicked",
color = 15158332,
fields = {
{ name = "Player", value = player.Name, inline = true },
{ name = "User ID", value = tostring(player.UserId), inline = true },
{ name = "Reason", value = reason or "NSFW / Condo Activity", inline = false }
},
timestamp = DateTime.now():ToIsoDate()
}}
})
})
end)
end
local function checkPlayer(player)
local success, result = pcall(function()
local response = HttpService:RequestAsync({
Url = SHIELD_URL .. "/" .. tostring(player.UserId),
Method = "GET",
Headers = { ["X-API-Key"] = API_KEY }
})
return HttpService:JSONDecode(response.Body)
end)
if success and result.flagged then
sendWebhook(player, result.reason)
player:Kick([[
[SHIELD]
You have been kicked from this game.
Reason: NSFW / Condo Activity
This action was taken automatically by Shield
to protect this community.
]])
end
end
Players.PlayerAdded:Connect(checkPlayer)
for _, player in ipairs(Players:GetPlayers()) do
task.spawn(checkPlayer, player)
end