R

hat em

public
rrixh Apr 07, 2024 Never 98
Clone
Plaintext hatEmlulas 509 lines (430 loc) | 13.4 KB
1
function mOut(txt, type)
2
if type == 1 then
3
spawn(function()
4
local m = Instance.new("Message", game.CoreGui)
5
m.Text = txt
6
task.wait(3)
7
m:Destroy()
8
end)
9
elseif type == 2 then
10
spawn(function()
11
local h = Instance.new("Hint", game.CoreGui)
12
h.Text = txt
13
task.wait(3)
14
h:Destroy()
15
end)
16
end
17
end
18
19
20
-- Gui to Lua
21
-- Version: 3.2
22
23
-- Instances:
24
25
local ScreenGui = Instance.new("ScreenGui")
26
local Main = Instance.new("Frame")
27
local UIGradient = Instance.new("UIGradient")
28
local UICorner = Instance.new("UICorner")
29
local Punish = Instance.new("TextBox")
30
local UICorner_2 = Instance.new("UICorner")
31
local SilentCMD = Instance.new("TextBox")
32
local UICorner_3 = Instance.new("UICorner")
33
local SilentC = Instance.new("TextButton")
34
local UICorner_4 = Instance.new("UICorner")
35
local X = Instance.new("TextButton")
36
local UICorner_5 = Instance.new("UICorner")
37
38
ScreenGui.Parent = game.CoreGui
39
ScreenGui.ResetOnSpawn = false
40
Main.Active = true
41
Main.Draggable = true
42
43
--Properties:
44
45
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
46
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
47
48
Main.Name = "Main"
49
Main.Parent = ScreenGui
50
Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
51
Main.BackgroundTransparency = 0.110
52
Main.BorderColor3 = Color3.fromRGB(27, 42, 53)
53
Main.Position = UDim2.new(0.348, 0,0.372, 0)
54
Main.Size = UDim2.new(0, 299, 0, 148)
55
56
UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(18, 4, 0)), ColorSequenceKeypoint.new(0.20, Color3.fromRGB(16, 3, 0)), ColorSequenceKeypoint.new(0.47, Color3.fromRGB(13, 2, 0)), ColorSequenceKeypoint.new(0.73, Color3.fromRGB(16, 3, 0)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(18, 4, 0))}
57
UIGradient.Parent = Main
58
59
UICorner.Parent = Main
60
61
Punish.Name = "Punish"
62
Punish.Parent = Main
63
Punish.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
64
Punish.BackgroundTransparency = 0.650
65
Punish.Position = UDim2.new(0.163879603, 0, 0.121621624, 0)
66
Punish.Size = UDim2.new(0, 200, 0, 40)
67
Punish.Font = Enum.Font.SourceSans
68
Punish.PlaceholderText = "Player name..."
69
Punish.Text = ""
70
Punish.TextColor3 = Color3.fromRGB(255, 255, 255)
71
Punish.TextSize = 14.000
72
73
UICorner_2.Parent = Punish
74
75
SilentCMD.Name = "SilentCMD"
76
SilentCMD.Parent = Main
77
SilentCMD.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
78
SilentCMD.BackgroundTransparency = 0.650
79
SilentCMD.Position = UDim2.new(0.163879603, 0, 0.445945948, 0)
80
SilentCMD.Size = UDim2.new(0, 200, 0, 40)
81
SilentCMD.Font = Enum.Font.SourceSans
82
SilentCMD.PlaceholderText = "Hat name..."
83
SilentCMD.Text = ""
84
SilentCMD.TextColor3 = Color3.fromRGB(255, 255, 255)
85
SilentCMD.TextSize = 14.000
86
87
UICorner_3.Parent = SilentCMD
88
89
SilentC.Name = "SilentC"
90
SilentC.Parent = Main
91
SilentC.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
92
SilentC.BackgroundTransparency = 0.650
93
SilentC.Position = UDim2.new(0.337792635, 0, 0.756756783, 0)
94
SilentC.Size = UDim2.new(0, 97, 0, 29)
95
SilentC.Font = Enum.Font.SourceSans
96
SilentC.Text = "Hat em"
97
SilentC.TextColor3 = Color3.fromRGB(255, 255, 255)
98
SilentC.TextSize = 14.000
99
100
UICorner_4.Parent = SilentC
101
102
X.Name = "X"
103
X.Parent = Main
104
X.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
105
X.BackgroundTransparency = 0.650
106
X.Position = UDim2.new(0.916387975, 0, 0, 0)
107
X.Size = UDim2.new(0, 25, 0, 18)
108
X.Font = Enum.Font.SourceSans
109
X.Text = "X"
110
X.TextColor3 = Color3.fromRGB(255, 255, 255)
111
X.TextSize = 14.000
112
113
UICorner_5.Parent = X
114
115
function getPlayer(shortcut)
116
local player = nil
117
local g = game.Players:GetPlayers()
118
for i = 1, #g do
119
if string.lower(string.sub(g[i].Name,1,string.len(shortcut))) == string.lower(shortcut) then
120
if g[i] ~= nil then
121
player = g[i]
122
break
123
end
124
end
125
end
126
return player
127
end
128
129
function getHat(shortcuts)
130
local hat = nil
131
for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
132
if v:IsA("Accessory") then
133
if string.lower(string.sub(v.Name,1,string.len(shortcuts))) == string.lower(shortcuts) then
134
if v.Name ~= nil then
135
hat = v
136
break
137
end
138
end
139
end
140
end
141
return hat
142
end
143
144
local runcode = true
145
local spawntime = game.Players.RespawnTime + 3
146
147
local hatstored = {}
148
149
SilentC.MouseButton1Click:Connect(function()
150
wait()
151
ScreenGui:Destroy()
152
wait(0.2)
153
function mOut(txt, type)
154
if type == 1 then
155
spawn(function()
156
local m = Instance.new("Message", game.CoreGui)
157
m.Text = txt
158
task.wait(3)
159
m:Destroy()
160
end)
161
elseif type == 2 then
162
spawn(function()
163
local h = Instance.new("Hint", game.CoreGui)
164
h.Text = txt
165
task.wait(3)
166
h:Destroy()
167
end)
168
end
169
end
170
171
172
-- Gui to Lua
173
-- Version: 3.2
174
175
-- Instances:
176
177
local ScreenGui = Instance.new("ScreenGui")
178
local Main = Instance.new("Frame")
179
local UIGradient = Instance.new("UIGradient")
180
local UICorner = Instance.new("UICorner")
181
local Punish = Instance.new("TextBox")
182
local UICorner_2 = Instance.new("UICorner")
183
local SilentCMD = Instance.new("TextBox")
184
local UICorner_3 = Instance.new("UICorner")
185
local SilentC = Instance.new("TextButton")
186
local UICorner_4 = Instance.new("UICorner")
187
local X = Instance.new("TextButton")
188
local UICorner_5 = Instance.new("UICorner")
189
190
ScreenGui.Parent = game.CoreGui
191
ScreenGui.ResetOnSpawn = false
192
Main.Active = true
193
Main.Draggable = true
194
195
--Properties:
196
197
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
198
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
199
200
Main.Name = "Main"
201
Main.Parent = ScreenGui
202
Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
203
Main.BackgroundTransparency = 0.110
204
Main.BorderColor3 = Color3.fromRGB(27, 42, 53)
205
Main.Position = UDim2.new(0.348, 0,0.372, 0)
206
Main.Size = UDim2.new(0, 299, 0, 148)
207
208
UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(18, 4, 0)), ColorSequenceKeypoint.new(0.20, Color3.fromRGB(16, 3, 0)), ColorSequenceKeypoint.new(0.47, Color3.fromRGB(13, 2, 0)), ColorSequenceKeypoint.new(0.73, Color3.fromRGB(16, 3, 0)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(18, 4, 0))}
209
UIGradient.Parent = Main
210
211
UICorner.Parent = Main
212
213
Punish.Name = "Punish"
214
Punish.Parent = Main
215
Punish.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
216
Punish.BackgroundTransparency = 0.650
217
Punish.Position = UDim2.new(0.163879603, 0, 0.121621624, 0)
218
Punish.Size = UDim2.new(0, 200, 0, 40)
219
Punish.Font = Enum.Font.SourceSans
220
Punish.PlaceholderText = "Player name..."
221
Punish.Text = ""
222
Punish.TextColor3 = Color3.fromRGB(255, 255, 255)
223
Punish.TextSize = 14.000
224
225
UICorner_2.Parent = Punish
226
227
SilentCMD.Name = "SilentCMD"
228
SilentCMD.Parent = Main
229
SilentCMD.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
230
SilentCMD.BackgroundTransparency = 0.650
231
SilentCMD.Position = UDim2.new(0.163879603, 0, 0.445945948, 0)
232
SilentCMD.Size = UDim2.new(0, 200, 0, 40)
233
SilentCMD.Font = Enum.Font.SourceSans
234
SilentCMD.PlaceholderText = "Hat name..."
235
SilentCMD.Text = ""
236
SilentCMD.TextColor3 = Color3.fromRGB(255, 255, 255)
237
SilentCMD.TextSize = 14.000
238
239
UICorner_3.Parent = SilentCMD
240
241
SilentC.Name = "SilentC"
242
SilentC.Parent = Main
243
SilentC.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
244
SilentC.BackgroundTransparency = 0.650
245
SilentC.Position = UDim2.new(0.337792635, 0, 0.756756783, 0)
246
SilentC.Size = UDim2.new(0, 97, 0, 29)
247
SilentC.Font = Enum.Font.SourceSans
248
SilentC.Text = "Hat em"
249
SilentC.TextColor3 = Color3.fromRGB(255, 255, 255)
250
SilentC.TextSize = 14.000
251
252
UICorner_4.Parent = SilentC
253
254
X.Name = "X"
255
X.Parent = Main
256
X.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
257
X.BackgroundTransparency = 0.650
258
X.Position = UDim2.new(0.916387975, 0, 0, 0)
259
X.Size = UDim2.new(0, 25, 0, 18)
260
X.Font = Enum.Font.SourceSans
261
X.Text = "X"
262
X.TextColor3 = Color3.fromRGB(255, 255, 255)
263
X.TextSize = 14.000
264
265
UICorner_5.Parent = X
266
267
function getPlayer(shortcut)
268
local player = nil
269
local g = game.Players:GetPlayers()
270
for i = 1, #g do
271
if string.lower(string.sub(g[i].Name,1,string.len(shortcut))) == string.lower(shortcut) then
272
if g[i] ~= nil then
273
player = g[i]
274
break
275
end
276
end
277
end
278
return player
279
end
280
281
function getHat(shortcuts)
282
local hat = nil
283
for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
284
if v:IsA("Accessory") then
285
if string.lower(string.sub(v.Name,1,string.len(shortcuts))) == string.lower(shortcuts) then
286
if v.Name ~= nil then
287
hat = v
288
break
289
end
290
end
291
end
292
end
293
return hat
294
end
295
296
local runcode = true
297
local spawntime = game.Players.RespawnTime + 3
298
299
local hatstored = {}
300
301
SilentC.MouseButton1Click:Connect(function()
302
wait()
303
ScreenGui:Destroy()
304
wait(0.2)
305
306
wait()
307
local char = game.Players.LocalPlayer.Character
308
if runcode then
309
runcode = false
310
311
local dfc = game.ReplicatedStorage.DefaultChatSystemChatEvents
312
local smr = dfc.SayMessageRequest
313
314
local hatse = getHat(SilentCMD.Text)
315
local arg = getPlayer(Punish.Text)
316
317
if table.find(hatstored, hatse.Name) then
318
mOut("Hat is already given away, error", 1)
319
return end
320
321
argplr = game.Players[arg.Name].Character
322
323
local rs = game:GetService("RunService")
324
local fc
325
local dc
326
local dic
327
local coc
328
char.Archivable = true
329
headname = char.Head.Name
330
local cchar = char:Clone()
331
cchar.Parent = Workspace
332
333
local con
334
con = char.Humanoid.Died:Connect(function()
335
cchar:Destroy()
336
Main.Visible = false
337
runcode = false
338
mOut("Wait For "..tostring(spawntime).." Second", 1)
339
table.clear(hatstored)
340
task.wait(spawntime)
341
Main.Visible = true
342
runcode = true
343
con:Disconnect()
344
end)
345
346
if fakeadmin then
347
smr:FireServer(";givehat "..hatse.Name.." "..arg.Name, "All")
348
end
349
350
cchar.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
351
for i, x in pairs(cchar:GetDescendants()) do
352
if x:IsA("BasePart") then
353
x.Transparency = 1
354
end
355
end
356
for i, v in pairs(cchar.Head:GetDescendants()) do
357
if v.className == "Decal" or v.className == "Texture" then
358
v.Transparency = 1
359
end
360
end
361
362
for i,v in pairs(char:GetDescendants()) do
363
if v:IsA("BasePart") and v.Name ~="HumanoidRootPart" then
364
fc = rs.Heartbeat:Connect(function()
365
if char.Humanoid.Health <= 0 then fc:Disconnect() return end
366
v.Velocity = Vector3.new(30, 4, 0)
367
v.RotVelocity = Vector3.new(30, 4, 0)
368
end)
369
end
370
371
dic = rs.RenderStepped:Connect(function()
372
setscriptable(plr, "SimulationRadius", true)
373
plr.SimulationRadius = math.huge * math.huge, math.huge * math.huge * 1 / 0 * 1 / 0 * 1 / 0 * 1 / 0 * 1 / 0
374
end)
375
376
coc = plr.SimulationRadiusChanged:Connect(function(radius)
377
radius = math.huge
378
return radius
379
end)
380
381
char[hatse.Name].Handle.AccessoryWeld:Destroy()
382
383
dc = rs.RenderStepped:Connect(function()
384
if char.Humanoid.Health <= 0 then dc:Disconnect() cchar:Destroy() coc:Disconnect() dic:Disconnect() return end
385
cchar.HumanoidRootPart.CFrame = argplr.HumanoidRootPart.CFrame
386
char[hatse.Name].Handle.CFrame = cchar[hatse.Name].Handle.CFrame
387
end)
388
table.insert(hatstored, hatse.Name)
389
end
390
runcode = true
391
end
392
393
X.MouseButton1Click:Connect(function()
394
ScreenGui:Destroy()
395
end)
396
397
mOut("Hat Giver Has Loaded", 2)
398
399
wait(0.2)
400
print("What accessories you have on")
401
for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
402
if v:IsA("Accessory") then
403
print("What accessories you have on")
404
print(v.Name)
405
end
406
end
407
end)
408
wait()
409
local char = game.Players.LocalPlayer.Character
410
if runcode then
411
runcode = false
412
413
local dfc = game.ReplicatedStorage.DefaultChatSystemChatEvents
414
local smr = dfc.SayMessageRequest
415
416
local hatse = getHat(SilentCMD.Text)
417
local arg = getPlayer(Punish.Text)
418
419
if table.find(hatstored, hatse.Name) then
420
mOut("Hat is already given away, error", 1)
421
return end
422
423
argplr = game.Players[arg.Name].Character
424
425
local rs = game:GetService("RunService")
426
local fc
427
local dc
428
local dic
429
local coc
430
char.Archivable = true
431
headname = char.Head.Name
432
local cchar = char:Clone()
433
cchar.Parent = Workspace
434
435
local con
436
con = char.Humanoid.Died:Connect(function()
437
cchar:Destroy()
438
Main.Visible = false
439
runcode = false
440
mOut("Wait For "..tostring(spawntime).." Second", 1)
441
table.clear(hatstored)
442
task.wait(spawntime)
443
Main.Visible = true
444
runcode = true
445
con:Disconnect()
446
end)
447
448
if fakeadmin then
449
smr:FireServer(";givehat "..hatse.Name.." "..arg.Name, "All")
450
end
451
452
cchar.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
453
for i, x in pairs(cchar:GetDescendants()) do
454
if x:IsA("BasePart") then
455
x.Transparency = 1
456
end
457
end
458
for i, v in pairs(cchar.Head:GetDescendants()) do
459
if v.className == "Decal" or v.className == "Texture" then
460
v.Transparency = 1
461
end
462
end
463
464
for i,v in pairs(char:GetDescendants()) do
465
if v:IsA("BasePart") and v.Name ~="HumanoidRootPart" then
466
fc = rs.Heartbeat:Connect(function()
467
if char.Humanoid.Health <= 0 then fc:Disconnect() return end
468
v.Velocity = Vector3.new(30, 4, 0)
469
v.RotVelocity = Vector3.new(30, 4, 0)
470
end)
471
end
472
473
dic = rs.RenderStepped:Connect(function()
474
setscriptable(plr, "SimulationRadius", true)
475
plr.SimulationRadius = math.huge * math.huge, math.huge * math.huge * 1 / 0 * 1 / 0 * 1 / 0 * 1 / 0 * 1 / 0
476
end)
477
478
coc = plr.SimulationRadiusChanged:Connect(function(radius)
479
radius = math.huge
480
return radius
481
end)
482
483
char[hatse.Name].Handle.AccessoryWeld:Destroy()
484
485
dc = rs.RenderStepped:Connect(function()
486
if char.Humanoid.Health <= 0 then dc:Disconnect() cchar:Destroy() coc:Disconnect() dic:Disconnect() return end
487
cchar.HumanoidRootPart.CFrame = argplr.HumanoidRootPart.CFrame
488
char[hatse.Name].Handle.CFrame = cchar[hatse.Name].Handle.CFrame
489
end)
490
table.insert(hatstored, hatse.Name)
491
end
492
runcode = true
493
end
494
495
X.MouseButton1Click:Connect(function()
496
ScreenGui:Destroy()
497
end)
498
499
mOut("Hat Giver Has Loaded", 2)
500
501
wait(0.2)
502
print("What accessories you have on")
503
for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
504
if v:IsA("Accessory") then
505
print("What accessories you have on")
506
print(v.Name)
507
end
508
end
509
end)