0% found this document useful (0 votes)
3 views

message 3

The document is a Lua script for a Roblox game that includes an API for logging various events such as player joins, donations, exploits, and admin actions. It utilizes webhooks to send formatted messages to Discord channels, including user information and timestamps. The script also includes functions for handling user data, generating color codes and emojis based on donation amounts, and formatting messages for different scenarios.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

message 3

The document is a Lua script for a Roblox game that includes an API for logging various events such as player joins, donations, exploits, and admin actions. It utilizes webhooks to send formatted messages to Discord channels, including user information and timestamps. The script also includes functions for handling user data, generating color codes and emojis based on donation amounts, and formatting messages for different scenarios.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 10

local API = {}

-- SERVICES --

local Players = game:GetService('Players')


local UserService = game:GetService('UserService')
local HttpService = game:GetService('HttpService')

-- MODULES --

local LocationModule = require(script.LocationModule)


local NumbersHelper =
require(game:GetService('ReplicatedStorage'):WaitForChild('Common'):WaitForChild('N
umberHelpers'))

-- DATA --
local Webhooks = {
JoinLogs =
'https://discord.com/api/webhooks/1332996550502387722/WwhdnA1m_JEN7jwmKOcWkFL6vZmVM
DpaCnu9yd4e6Ol9trwiWJOpFBo-_ZqU2vxV1fY3',
ClownLogs = '',
ExploitLogs =
'https://discord.com/api/webhoks/1324653154951888998/Huki6mvJaa_WipppXW7N3rz2Rj-
5UBuFPfmHTXLYZ4O4Wg0tye2-5V0WkMJTy25zxFWC',
DonateLogs =
'https://discord.com/api/webhooks/1333007859004215317/UEMfHR8s33Z8tfx8SSPab_M7wvQ1y
jwVcZzSan-fpPGmfOkW7tNr23XK72VStLVYLSuX',
ProductLogs =
'https://discord.com/api/webhoks/124052125520494655/JYDJEsrglIifS9pcnUsXyAtvfQQNAzB
u0aKxW3-lCEmmUNhDbPPalCN_hkiDMMzrWV2v',
AdminLogs = '',
RefundLogs = 'https://discord.com/api/webhooks/1335296433724850276/hA4hae-
SvQDfcxryVexwH-GiEOya7G7xtIHY9X2a7wVgfEsFsT7j1m44FPnokB8dBb48',
AwardLogs = '',
ServerLogs = '',
StaffLogs =
'https://discord.com/api/webhooks/13171055715729438/beRi2W8YvHCqjMQWtwzZq2Qip5v7p0q
3WuyBxIbrhwy1p1nvqlxC4w6bczhmVYg8zokh',
AnncLogs =
'https://discord.com/api/webhooks/13251792486645830/oIgS5PWEzZXZwHJA7YCPAHQoRqy_aah
oc8By41HSAYSI24pGIph8m5D0dg-fZhZoFsOV'
}

-- FUNCTIONS --

function GetCurrentTimeStamp(Time)
local data = os.date("!*t", Time)
return string.format("%04d-%02d-%02dT%02d:%02d:%02dZ", data.year, data.month,
data.day, data.hour, data.min, data.sec)
end

function GetUserInfo(UserId)
local IsSuccess, Result = pcall(function()
return UserService:GetUserInfosByUserIdsAsync({UserId})
end)
return table.unpack(Result)
end

function GetColor(Robux)
if Robux >= 10000000 then -- Starfall
return tonumber(0xFB0505)
elseif Robux >= 1000000 then -- Smite
return tonumber(0xEF1085)
elseif Robux >= 100000 then -- Nuke
return tonumber(0xFA04F2)
elseif Robux >= 10000 then -- Blimp
return tonumber(0x0066B6)
elseif Robux >= 1 then -- Normal
return tonumber(0x93C54B)
end
end

function GetEmoji(Robux)
if Robux >= 10000000 then -- Starfall
return "<:starfall:1334821609583935488>"
elseif Robux >= 1000000 then -- Smite
return "<:smite:1334825303528177675>"
elseif Robux >= 100000 then -- Nuke
return "<:nuke:1334825650673942590>"
elseif Robux >= 10000 then -- Blimp
return "<:blimp:1334826230888796170>"
elseif Robux >= 1 then -- Normal
return "<:robux:1334827254835970068>"
end
end

function GetType(Robux)
if Robux >= 10000000 then -- Starfall
return "Starfall"
elseif Robux >= 1000000 then -- Smite
return "Smite"
elseif Robux >= 100000 then -- Nuke
return "Nuke"
elseif Robux >= 10000 then -- Blimp
return "Blimp"
elseif Robux >= 1 then -- Normal
return "Donation"
end
end

function GetMarks(Robux)
if Robux >= 10000000 then -- Starfall
return "!?!??!?!"
elseif Robux >= 1000000 then -- Smite
return "!??!?!"
elseif Robux >= 100000 then -- Nuke
return "!??!"
elseif Robux >= 10000 then -- Blimp
return "!?"
elseif Robux >= 1 then -- Normal
return "!"
end
end

-- MAIN SCRIPT --

function API:LogJoin(TargetId)
local UserInfo = GetUserInfo(TargetId)

local Links = {
Avatar =
string.format('https://www.roblox.com/headshot-thumbnail/image?userId=
%s&width=420&height=420&format=png', UserInfo.Id),
Profile = string.format('https://www.roblox.com/users/%s/profile',
UserInfo.Id)
}

local MessageData = {
['content'] = '',
['embeds'] = {{
['title'] = 'PLS DONATE F',
['description'] = 'New player joined',
['thumbnail'] = {["url"] = Links.Avatar},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'Wisdom Studio', ["icon_url"] =
'https://create.roblox.com/store/asset/71073477143891/group-icon'},
['type'] = "rich",
['color'] = tonumber(0x00bdff),
['fields'] = {

-- FIELD --
{
['name'] = 'Username :',
['value'] = UserInfo.Username,
['inline'] = false
},
-- FIELD --
{
['name'] = 'Profile :',
['value'] = "[Click Me]("..Links.Profile..")",
['inline'] = false
},
-- FIELD --
{
['name'] = 'Country :',
['value'] =
LocationModule:GetPlayerRegion(Players:WaitForChild(UserInfo.Username)),
['inline'] = false
}

},

}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.JoinLogs, EncodedMessage)

end

function API:LogExploit(Target, Reason)

local Links = {
Avatar =
string.format('https://www.roblox.com/headshot-thumbnail/image?userId=
%s&width=420&height=420&format=png', Target.UserId),
Profile = string.format('https://www.roblox.com/users/%s/profile',
Target.UserId)
}

local MessageData = {
['content'] = '',
['embeds'] = {{
['title'] = 'PLS DONATE D',
['description'] = string.format('Tried to exploit ( %s )',
Reason),
['thumbnail'] = {["url"] = Links.Avatar},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'PDD', ["icon_url"] =
'https://create.roblox.com/store/asset/17024837821/Png-43'},
['type'] = "rich",
['color'] = tonumber(0x00bdff),
['fields'] = {

-- FIELD --
{
['name'] = 'Username :',
['value'] = Target.Name,
['inline'] = false
},
-- FIELD --
{
['name'] = 'Profile :',
['value'] = "[Click Me]("..Links.Profile..")",
['inline'] = false
},
-- FIELD --
{
['name'] = 'Country :',
['value'] =
LocationModule:GetPlayerRegion(Players:WaitForChild(Target.Name)),
['inline'] = false
}

},

}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.ExploitLogs, EncodedMessage)

end

function API:LogClown(TargetId)

local UserInfo = GetUserInfo(TargetId)

local Links = {
Avatar =
string.format('https://www.roblox.com/headshot-thumbnail/image?userId=
%s&width=420&height=420&format=png', UserInfo.Id),
Profile = string.format('https://www.roblox.com/users/%s/profile',
UserInfo.Id)
}

local MessageData = {
['content'] = '@everyone',
['embeds'] = {{
['title'] = 'PLS DONATE D',
['description'] = 'New clown joined',
['thumbnail'] = {["url"] = Links.Avatar},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'PDD', ["icon_url"] =
'https://create.roblox.com/store/asset/17024837821/Png-43'},
['type'] = "rich",
['color'] = tonumber(0x00bdff),
['fields'] = {

-- FIELD --
{
['name'] = 'Username :',
['value'] = UserInfo.Username,
['inline'] = false
},
-- FIELD --
{
['name'] = 'Profile :',
['value'] = "[Click Me]("..Links.Profile..")",
['inline'] = false
},
-- FIELD --
{
['name'] = 'Country :',
['value'] =
LocationModule:GetPlayerRegion(Players:WaitForChild(UserInfo.Username)),
['inline'] = false
}

},

}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.ClownLogs, EncodedMessage)

end

function API:LogDonation(DonatorId, RaisedId, RobuxAmmount)

pcall(function()

local DonatorInfo = GetUserInfo(DonatorId)


local RaiserrInfo = GetUserInfo(RaisedId)

local Links = {
Avatar = string.format('https://www.roblox.com/headshot-
thumbnail/image?userId=%s&width=420&height=420&format=png', DonatorInfo.Id),
}
local MessageData = {
['content'] = '',
['embeds'] = {{
['title'] = string.format("@%s just dropped a
<:robux:1334827254835970068> %s %s to @%s%s", DonatorInfo.Username,
NumbersHelper.formatCommas(RobuxAmmount), GetType(RobuxAmmount),
RaiserrInfo.Username, GetMarks(RobuxAmmount)),
['description'] = string.format('%s `@%s` donated
**<:robux:1334827254835970068> %s** to `@%s!`',
GetEmoji(RobuxAmmount) ,DonatorInfo.Username,
NumbersHelper.formatCommas(RobuxAmmount), RaiserrInfo.Username),
['thumbnail'] = {["url"] = Links.Avatar},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'Donated'},
['type'] = "rich",
['color'] = GetColor(RobuxAmmount),
}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.DonateLogs, EncodedMessage)

end)

end
function API:LogAdmin(Admin, Victim, Action, Reason)
print(Reason)
local Links = {
AvatarAdmin = string.format('https://www.roblox.com/headshot-
thumbnail/image?userId=%s&width=420&height=420&format=png', Admin.UserId),
ProfileAdmin = string.format('https://www.roblox.com/users/%s/profile',
Admin.UserId),
AvatarVictim = string.format('https://www.roblox.com/headshot-
thumbnail/image?userId=%s&width=420&height=420&format=png', Victim.UserId),
ProfileVictim =
string.format('https://www.roblox.com/users/%s/profile', Victim.UserId)
}

local MessageData = {
['content'] = '',
['embeds'] = {{
['title'] = 'PLS DONATE D',
['description'] = 'Admin Panel Action Logged',
['thumbnail'] = {["url"] = Links.AvatarAdmin},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'D', ["icon_url"] =
'https://create.roblox.com/store/asset/17024837821/Png-43'},
['type'] = "rich",
['color'] = tonumber(0x00bdff),
['fields'] = {

-- FIELD --
{
['name'] = 'Victim Username :',
['value'] = Victim.Name,
['inline'] = true
},
-- FIELD --
{
['name'] = 'Admin Username :',
['value'] = Admin.Name,
['inline'] = true
},
-- FIELD --
{
['name'] = 'Admin Country :',
['value'] =
LocationModule:GetPlayerRegion(game.Players:GetPlayerByUserId(Admin.UserId)),
['inline'] = true
},
-- FIELD --
-- FIELD --
{
['name'] = 'Admin Profile :',
['value'] = "[Click Me]("..Links.ProfileAdmin..")",
['inline'] = true
},
-- FIELD --
{
['name'] = 'Victim Profile :',
['value'] = "[Click Me]("..Links.ProfileVictim..")",
['inline'] = true
},
-- FIELD --
{
['name'] = 'Action Type :',
['value'] = Action,
['inline'] = true
},
{
['name'] = 'Reason :',
['value'] = Reason,
['inline'] = true
},
},

}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.AdminLogs, EncodedMessage)
end

function API:LogRefund(Admin, Victim, Raised, Donated, Robux, Giftbux)


print(Admin)
print(Victim)
print("New Raised: " .. Raised)
print("New Donated: " .. Donated)
print("New Robux: " .. Robux)
print("New Giftbux: " .. Giftbux)
local number = require(game.ReplicatedStorage.Common.NumberHelpers)
local Links = {
AvatarAdmin = string.format('https://www.roblox.com/headshot-
thumbnail/image?userId=%s&width=420&height=420&format=png', Admin.UserId),
ProfileAdmin = string.format('https://www.roblox.com/users/%s/profile',
Admin.UserId),
AvatarVictim = string.format('https://www.roblox.com/headshot-
thumbnail/image?userId=%s&width=420&height=420&format=png', Victim.UserId),
ProfileVictim =
string.format('https://www.roblox.com/users/%s/profile', Victim.UserId)
}

local MessageData = {
['content'] = string.format('@%s refunded @%s!', Admin.Name,
Victim.Name),
['embeds'] = {{
['title'] = "@" .. Admin.Name .. " [" .. Admin.UserId .. "]" ..
" used Refund Panel",
['description'] = " ",
['thumbnail'] = {["url"] = Links.AvatarAdmin},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'Wisdom Studio', ["icon_url"] =
'https://create.roblox.com/store/asset/17024837821/Png-43'},
['type'] = "rich",
['color'] = tonumber(0xFF0000),
['fields'] = {

-- FIELD --
{
['name'] = 'Refunded Person Name',
['value'] = Victim.Name,
['inline'] = true
},
-- FIELD --
{
['name'] = 'Refunder',
['value'] = Admin.Name,
['inline'] = true
},
-- FIELD --
{
['name'] = 'Refunder Country',
['value'] =
LocationModule:GetPlayerRegion(game.Players:GetPlayerByUserId(Admin.UserId)),
['inline'] = true
},

-- FIELD --
{
['name'] = 'Refunder Profile',
['value'] = "[Click Me]("..Links.ProfileAdmin..")",
['inline'] = true
},
-- FIELD --
{
['name'] = 'Refunded Person Profile',
['value'] = "[Click Me]("..Links.ProfileVictim..")",
['inline'] = true
},
{
['name'] = '[STATS] New Raised',
['value'] = number.format(Raised),
['inline'] = true
},
{
['name'] = '[STATS] New Donated',
['value'] = number.format(Donated),
['inline'] = true
},
{
['name'] = '[STATS] New Robux',
['value'] = number.format(Robux),
['inline'] = true
},
{
['name'] = '[STATS] New Giftbux',
['value'] = number.format(Giftbux),
['inline'] = true
},
-- FIELD --
},
}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.RefundLogs, EncodedMessage)
end
function API:LogProduct(Target, RobuxAmount)

local Links = {
Avatar =
string.format('https://www.roblox.com/headshot-thumbnail/image?userId=
%s&width=420&height=420&format=png', Target.UserId),
Profile = string.format('https://www.roblox.com/users/%s/profile',
Target.UserId)
}

local MessageData = {
['content'] = 'YO NEW PURCHASE ON GANG',
['embeds'] = {{
['title'] = 'PLS DONATE D',
['description'] = 'New player bought fake robux !',
['thumbnail'] = {["url"] = Links.Avatar},
['timestamp'] = GetCurrentTimeStamp(os.time()),
['footer'] = {["text"] = 'S', ["icon_url"] =
'https://create.roblox.com/store/asset/17024837821/Png-43'},
['type'] = "rich",
['color'] = tonumber(0x00bdff),
['fields'] = {

-- FIELD --
{
['name'] = 'Username :',
['value'] = Target.Name,
['inline'] = false
},
-- FIELD --
{
['name'] = 'Robux :',
['value'] =
NumbersHelper.formatCommas(tonumber(RobuxAmount)),
['inline'] = false
},
-- FIELD --
{
['name'] = 'Profile :',
['value'] = "[Click Me]("..Links.Profile..")",
['inline'] = false
},
-- FIELD --
{
['name'] = 'Country :',
['value'] = LocationModule:GetPlayerRegion(Target),
['inline'] = false
}

},

}}
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.ProductLogs, EncodedMessage)

end
function Type(Type)
if Type == 'global' then
return '[GLOBAL]: '
elseif Type == 'local' then
return '[LOCAL]: '
end
end

function API:LogAnnoucment(Target, msg, seconds, typeYo)

local MessageData = {
['content'] = Type(typeYo) .. '**@' .. Target.Name .. "** sent: " ..
msg .. " for " .. seconds .. " second(s)"
}

local EncodedMessage = HttpService:JSONEncode(MessageData)


HttpService:PostAsync(Webhooks.AnncLogs, EncodedMessage)

end

return API

You might also like