-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclient.lua
More file actions
236 lines (207 loc) · 6.36 KB
/
client.lua
File metadata and controls
236 lines (207 loc) · 6.36 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
--[[ ~ Credits ~
Main Script: Aim
Colors & Roles: 7n7o
Chat hook: Riptxde
--]]
if not game:IsLoaded() then
game.Loaded:Wait()
end
if not syn_checkcaller and not PROTOSMASHER_LOADED then error'Unsupported exploit.' end
if cross_settings then
myRoles = cross_settings.myRoles
myColor = cross_settings.myColor
RGB_ENABLED = cross_settings.RGB_ENABLED
WS_URL = cross_settings.WS_URL
ENCRYPTION_KEY = cross_settings.ENCRYPTION_KEY
end
if not WS_URL then error'Set the required global variables.' end
local socket
if syn_checkcaller then
socket = syn.websocket.connect(WS_URL)
elseif PROTOSMASHER_LOADED then
socket = WebSocket.new(WS_URL)
socket:ConnectToServer()
end
local StarterGui = game:GetService("StarterGui")
local LP = game:GetService("Players").LocalPlayer
getProperties = {
Color = Color3.fromRGB(255,255,0);
Font = Enum.Font.SourceSansBold;
TextSize = 18;
}
sendProperties = {
Color = myColor;
Font = Enum.Font.SourceSansBold;
TextSize = 18;
}
local iv = "h369ZWd@S2Y5U%Z!"
function encrypt(msg)
if syn_checkcaller then
return syn.crypt.custom.encrypt("aes-cbc", msg, ENCRYPTION_KEY, iv)
elseif PROTOSMASHER_LOADED then
return AES.Encrypt(msg, ENCRYPTION_KEY, iv)
end
end
function decrypt(msg)
if syn_checkcaller then
return syn.crypt.custom.decrypt("aes-cbc", msg, ENCRYPTION_KEY, iv)
elseif PROTOSMASHER_LOADED then
return AES.Decrypt(msg, ENCRYPTION_KEY, iv)
end
end
function toTable(s)
if not s:find '^%s*{' then return nil end
if s:find '[^\'"%w_]function[^\'"%w_]' then
return nil
end
s = 'return '..s
local chunk = loadstring(s,'tbl','t',{})
if not chunk then return nil end
local ok,ret = pcall(chunk)
if ok then return ret
else
return nil
end
end
function getMessage(enc)
if enc == "Connected" then
return enc
end
local message = toTable(decrypt(enc))
return message
end
function sendMessage(Message)
socket:Send(encrypt(Message))
end
function invite()
Server = tostring(game.PlaceId)..":"..tostring(game.JobId)
sendMessage("{Server = '"..Server.."', Name = 'SERVER',Roles = {}, Message = '"..LP.Name.." has invited you to join their server! Type !join to join.', Color = Color3.fromRGB(255, 255, 0)}")
end
local ServerToJoin = ""
function join()
lol = ServerToJoin:split":"
game:GetService("TeleportService"):TeleportToPlaceInstance(tonumber(lol[1]), lol[2], LP)
end
function constructRoles(r)
local a = ""
for i, v in pairs(r) do
a = a.."["..v.."] "
end
return a
end
function tostringr(r)
local a = "{"
for i, v in pairs(r) do
a = a.."'"..v.."', "
end
return a:sub(1, #a-2).."}"
end
local enabled = false
function chat(msg)
if enabled then
sendProperties.Text = construct({Name =tostring(LP.Name),Roles = myRoles, Message = msg, Color = tostring(myColor)})
StarterGui:SetCore("ChatMakeSystemMessage", sendProperties)
sendMessage("{Name = '"..tostring(LP.Name).."',Roles = "..tostringr(myRoles)..", Message = '"..msg.."', Color = Color3.new("..tostring(myColor)..")}")
end
end
function construct(messageTbl)
if messageTbl.Server then
ServerToJoin = messageTbl.Server
end
local endm = ""
endm = endm..constructRoles(messageTbl.Roles)
endm = endm.."["..messageTbl.Name.."]: "
endm = endm..messageTbl.Message
getProperties.Color = messageTbl.Color
return endm
end
local lastmessage = {}
local received = function(msg)
lastmessage = getMessage(msg)
if not lastmessage then return end
if type(lastmessage) == "string" then
getProperties.Text = "Connected"
else
getProperties.Text = construct(lastmessage)
end
StarterGui:SetCore("ChatMakeSystemMessage", getProperties)
end
if syn_checkcaller then
socket.OnMessage:Connect(received)
elseif PROTOSMASHER_LOADED then
socket.OnMessage = received
end
sendMessage("{Name = 'SERVER',Roles = {}, Message = '"..LP.Name.." has joined the chat!', Color = Color3.fromRGB(255, 255, 0)}")
getProperties.Color = Color3.fromRGB(255, 255, 0)
getProperties.Text = "[SERVER] Say !c or !chat to toggle sending, and !invite to invite people to this server."
StarterGui:SetCore("ChatMakeSystemMessage", getProperties)
local scroller = LP:FindFirstChild("PlayerGui").Chat.Frame.ChatChannelParentFrame.Frame_MessageLogDisplay.Scroller
scroller.ChildAdded:Connect(function(frame)
if RGB_ENABLED then
pcall(function()
if frame.TextLabel.Text == construct(lastmessage) then
if lastmessage.Roles[1] == "RGB" then
spawn(function()
function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end
counter = 0
while wait(0.1) do
frame.TextLabel.TextColor3 = Color3.fromHSV(zigzag(counter),1,1)
counter = counter + 0.01
end
end)
end
end
end)
end
end)
function toggle()
enabled = not enabled
if enabled then
getProperties.Color = Color3.fromRGB(0, 230, 0)
getProperties.Text = "[SERVER] Sending Enabled"
else
getProperties.Color = Color3.fromRGB(230, 0, 0)
getProperties.Text = "[SERVER] Sending Disabled"
end
StarterGui:SetCore("ChatMakeSystemMessage", getProperties)
end
local CBar, CRemote, Connected = LP['PlayerGui']:WaitForChild('Chat')['Frame'].ChatBarParentFrame['Frame'].BoxFrame['Frame'].ChatBar, game:GetService('ReplicatedStorage').DefaultChatSystemChatEvents['SayMessageRequest'], {}
local HookChat = function(Bar)
coroutine.wrap(function()
if not table.find(Connected,Bar) then
local Connect = Bar['FocusLost']:Connect(function(Enter)
if Enter ~= false and Bar['Text'] ~= '' then
local Message = Bar['Text']
Bar['Text'] = '';
if Message == "!c" or Message == "!chat" then
toggle()
elseif Message == "!invite" then
invite()
elseif Message == "!join" then
join()
elseif enabled then
chat(Message)
else
game:GetService('Players'):Chat(Message); CRemote:FireServer(Message,'All')
end
end
end)
Connected[#Connected+1] = Bar; Bar['AncestryChanged']:Wait(); Connect:Disconnect()
end
end)()
end
HookChat(CBar); local BindHook = Instance.new('BindableEvent')
local MT = getrawmetatable(game); local NC = MT.__namecall; setreadonly(MT, false)
MT.__namecall = newcclosure(function(...)
local Method, Args = getnamecallmethod(), {...}
if rawequal(tostring(Args[1]),'ChatBarFocusChanged') and rawequal(Args[2],true) then
if LP['PlayerGui']:FindFirstChild('Chat') then
BindHook:Fire()
end
end
return NC(...)
end)
BindHook['Event']:Connect(function()
CBar = LP['PlayerGui'].Chat['Frame'].ChatBarParentFrame['Frame'].BoxFrame['Frame'].ChatBar
HookChat(CBar)
end)