-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.lua
23 lines (19 loc) · 959 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--Made by Tazio
AddEventHandler('chatMessage', function(source, name, msg)
if string.match(msg, "[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?") and string.match(msg, "https?://[%w-_%.%?%.:/%+=&]+") then -- IP address
CancelEvent()
msg = msg:gsub("https?://[%w-_%.%?%.:/%+=&]+", "blocked_link")
msg = msg:gsub("[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?", "blocked_ip")
TriggerClientEvent('chatMessage', -1, name, { 255, 255, 255 }, msg)
end
if string.match(msg, "[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?") then -- IP address
CancelEvent()
msg = msg:gsub("[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?%.[12]?%d%d?", "blocked_ip")
TriggerClientEvent('chatMessage', -1, name, { 255, 255, 255 }, msg)
end
if string.match(msg, "https?://[%w-_%.%?%.:/%+=&]+") then -- Link
CancelEvent()
msg = msg:gsub("https?://[%w-_%.%?%.:/%+=&]+", "blocked_link")
TriggerClientEvent('chatMessage', -1, name, { 255, 255, 255 }, msg)
end
end)