View difference between Paste ID: gr8xr1BL and vqF4Pxws
SHOW: | | - or go back to the newest paste.
1
--[[ 
2
	VAPE PRIVATE - leak and I'll break ur kneecaps
3
4
	Credits
5
	Infinite Yield - Blink
6
	DevForum - lots of rotation math because I hate it
7
	Please notify me if you need credits
8
]]
9
local GuiLibrary = shared.GuiLibrary
10
local players = game:GetService("Players")
11
local textservice = game:GetService("TextService")
12
local repstorage = game:GetService("ReplicatedStorage")
13
local lplr = players.LocalPlayer
14
local lighting = game:GetService("Lighting")
15
local cam = workspace.CurrentCamera
16
workspace:GetPropertyChangedSignal("CurrentCamera"):connect(function()
17
	cam = (workspace.CurrentCamera or workspace:FindFirstChild("Camera") or Instance.new("Camera"))
18
end)
19
local targetinfo = shared.VapeTargetInfo
20
local collectionservice = game:GetService("CollectionService")
21
local uis = game:GetService("UserInputService")
22
local mouse = lplr:GetMouse()
23
local bedwars = {}
24
local bedwarsblocks = {}
25
local blockraycast = RaycastParams.new()
26
blockraycast.FilterType = Enum.RaycastFilterType.Whitelist
27
local getfunctions
28
local oldchar
29
local oldcloneroot
30
local matchState = 0
31
local kit = ""
32
local antivoidypos = 0
33
local kills = 0
34
local beds = 0
35
local lagbacks = 0
36
local reported = 0
37
local vec3 = Vector3.new
38
local cfnew = CFrame.new
39
local currentinventory = {
40
	["inventory"] = {
41
		["items"] = {},
42
		["armor"] = {},
43
		["hand"] = nil
44
	}
45
}
46
local disguisecheck = false
47
local betterisfile = function(file)
48
	local suc, res = pcall(function() return readfile(file) end)
49
	return suc and res ~= nil
50
end
51
local requestfunc = syn and syn.request or http and http.request or http_request or fluxus and fluxus.request or request or function(tab)
52
	if tab.Method == "GET" then
53
		return {
54
			Body = game:HttpGet(tab.Url, true),
55
			Headers = {},
56
			StatusCode = 200
57
		}
58
	else
59
		return {
60
			Body = "bad exploit",
61
			Headers = {},
62
			StatusCode = 404
63
		}
64
	end
65
end 
66
local queueteleport = syn and syn.queue_on_teleport or queue_on_teleport or fluxus and fluxus.queue_on_teleport or function() end
67
local teleportfunc
68
local getasset = getsynasset or getcustomasset or function(location) return "rbxasset://"..location end
69
local storedshahashes = {}
70
local oldshoot
71
local chatconnection
72
local blocktable
73
local inventories = {}
74
local Hitboxes = {["Enabled"] = false}
75
local Reach = {["Enabled"] = false}
76
local Killaura = {["Enabled"] = false}
77
local nobob = {["Enabled"] = false}
78
local AnticheatBypass = {["Enabled"] = false}
79
local AnticheatBypassCombatCheck = {["Enabled"] = false}
80
local combatcheck = false
81
local combatchecktick = tick()
82
local disabletpcheck = false
83
local queueType = "bedwars_test"
84
local FastConsume = {["Enabled"] = false}
85
local chatconnection2
86
local oldchanneltab
87
local oldchannelfunc
88
local oldchanneltabs = {}
89
local connectionstodisconnect = {}
90
local anticheatfunny = false
91
local anticheatfunnyyes = false
92
local tpstring
93
local networkownertick = tick()
94
local networkownerfunc = isnetworkowner or function(part)
95
	if gethiddenproperty(part, "NetworkOwnershipRule") == Enum.NetworkOwnership.Manual then 
96
		sethiddenproperty(part, "NetworkOwnershipRule", Enum.NetworkOwnership.Automatic)
97
		networkownertick = tick() + 8
98
	end
99
	return networkownertick <= tick()
100
end
101
local uninjectflag = false
102-
local clients = {
102+
103-
	ChatStrings1 = {
103+
104-
		["KVOP25KYFPPP4"] = "vape",
104+
105-
		["IO12GP56P4LGR"] = "future",
105+
106-
		["RQYBPTYNURYZC"] = "rektsky"
106+
107-
	},
107+
108-
	ChatStrings2 = {
108+
109-
		["vape"] = "KVOP25KYFPPP4",
109+
110-
		["future"] = "IO12GP56P4LGR",
110+
111-
		["rektsky"] = "RQYBPTYNURYZC"
111+
112-
	},
112+
113-
	ClientUsers = {}
113+
114
			RunLoops.RenderStepTable[name] = nil
115-
local function GetURL(scripturl)
115+
116-
	if shared.VapeDeveloper then
116+
117-
		return readfile("vape/"..scripturl)
117+
118
	function RunLoops:BindToStepped(name, num, func)
119-
		return game:HttpGet("https://raw.githubusercontent.com/7GrandDadPGN/VapeV4ForRoblox/main/"..scripturl, true)
119+
120
			RunLoops.StepTable[name] = game:GetService("RunService").Stepped:connect(func)
121
		end
122-
local shalib = loadstring(GetURL("Libraries/sha.lua"))()
122+
123-
local entity = shared.vapeentity
123+
124-
local whitelisted = {
124+
125-
	players = {
125+
126-
		"edbf7c4bd824bb17954c0fee8f108b6263a23d58e1dc500157513409cd9c55433ad43ea5c8bb121602fcd0eb0137d64805aaa8c597521298f5b53d69fa82014b", 
126+
127-
        "94a10e281a721c62346185156c15dcc62a987aa9a73c482db4d1b0f2b4673261ec808040fb70886bf50453c7af97903ffe398199b43fccf5d8b619121493382d",
127+
128-
        "a91361a785c34c433f33386ef224586b7076e1e10ebb8189fdc39b7e37822eb6c79a7d810e0d2d41e000db65f8c539ffe2144e70d48e6d3df7b66350d4699c36",
128+
129-
        "cd41b8c39abf4b186f611f3afd13e5d0a2e5d65540b0dab93eed68a68f3891e0448d87dbba0937395ab1b7c3d4b6aed4025caad2b90b2cdbf4ca69441644d561",
129+
130-
        "28f1c2514aea620a23ef6a1f084e86a993e2585110c1ddd7f98cc6b3bd331251382c0143f7520153c91a368be5683d3406e06c9e35fba61f8bd2ac811c05f46b",
130+
131-
        "8b6c2833fa6e3a7defdeb8ffb4dcd6d4c652e6d02621c054df7c44ebaf94858ac5cbed6a6aadf0270c07d7054b7a2dd1ebf49ab20ffbc567213376c7848b8b90",
131+
132-
        "6662a5dfbb5311ee66af25cf9b6255c8b70f977022fcaed8fa9e6bcb4fe0159c148835d7c3b599a5f92f9a67455e0158f8977f33e9306dd4cee3efceb0b75441",
132+
133-
        "bdf4e13afb63148ad68cf75e25ec6f0cf11e0c4a597e8bdd5c93724a44bde2ce12eee46549a90ae4390bbfa36f8c662b7634600c552ca21d093004d473f9b23f",
133+
134-
        "6f3e2567502502ac053f72a3ad27eead7aeef4f0ad7b1695150040c36de8868b045ac0ac7e75dab8b9e973fea0561ad1f9fa4ea9f57bfee6ad59ff6b440640ff",
134+
135-
        "96fdd47dbac073243048420c583ff9ef999f5d009dcac2b40e16fb8ec08269eba30bb94c830ce82ef7711a2cd18fc43d2a495fb9ba37d42c5047fe4f1c7315a6",
135+
136-
        "cc5ec617693d5c0b67c591adbc3560e2b4ee11ec87a625c5a026d8d1b57d82a3965ea4874a4deabee7015c9a5a1d52d0d75e2821c36a5b5ea21f0f72e100cbb7",
136+
137-
        "a650c02f7ae2a15303926b520213a7b74382c0be925e649733ab9d2e028462af51cec91357647907a76029951910e9fcb524fdb8f78c6c2df4e6d56d3b215ddd",
137+
138-
        "ae55a45820f801cfb2e0539c079dec830f0765b2a431eaa26957bf17054e0d93fbf28e9538c812d0b79cd20bd2862a8fd930b8d4f838c1cd135344e2d6f0e85e",
138+
139-
        "6ff2157b9f16703f12a08980cff9f23a56e20de493b38c816dbe36f519155eb27751d1aabb10b8859850c88d8921b49fbac13d67cbfba3cca36f31afd1d4db85",
139+
140-
        "33cc2e81258d38699b3638e9888e0263904ae3ee5ea1f14bab25c52dc1f0eb7212bb9ea3bcb2c45a1f577286a0319ac9952f4181908161276af6db22f49901a3",
140+
141-
        "4316131222bddc978cea052e43b958c689190f7fc1308da43dccfc04f0cb0637c0cc328e130406993e83a1b2f63c4b2a5267080b6c344282a5314b0be6c6b79e",
141+
142-
        "cf22724d1d4368338f59bab33321c1ded4fdbefc5f254d832d68db49a861e9fc546049a1e7b63076e5fef2c29faf127156396433ca3c73bb6630420d6e4e4e4f",
142+
143-
        "75967edb96b649fdc44d81c7d1085b72cc3c638d564d7cd3cded4c1713fc7d7e8e286dcc8e2b8858634e807aa760311af077840d0a6b3a6d7a90a8d2bd3ac171",
143+
144-
        "34664958478e9c40b1befa4a73dac9e16d8b1e3ffe2f7a0b25f2defb1b1f8a469116970b2fc720540903b240abc9b3986fe91ef9333d4fab26945535a4af1dcd",
144+
145-
        "2892f7112427bcd09afbc6e57a8152839641ecf932134bb90eb0bdd730afdb6dc99829b78e2380977f529afc50d3cbca30d224b8f13dd60e465c120ef10ab651",
145+
146-
        "9dc7a3fd30ef6c7d68da21b8a0c954c49c78710079118892d85aac93f12025fed982a4c2184fff001c616d8f59a034d70c3d85677be383c300ed95a6984e42ac",
146+
147-
        "edc25420a498cac15a3c38d298765a948ddae5007c15c77fbc5aa6c65149c968ce20eb916024ddd4c6e47aeaae9b10d13e1d0b245089f04db2902b1eda643cbc",
147+
148-
        "95520901447cb29c4a8b0c6376e5a10d8a05cc2225e0a64789ce917e27db891cd9c1aa3cd27869941ef797492fab2e3dd903db8100e57e0842577cfb35f45848",
148+
149-
        "7141c96de6ca4e94f407b1b4803f32fe72322213d94310445b69c11be913d6ceb3777e04e19ab8ff76c12260e6705035311e673b68b0763ebff2a3d67a06f90d",
149+
150-
        "3b84ce0a89a50a01299cf4582fd0ed164a8cb24289ac3a4afc3a652e9aacad0a9e17caa2c787cd3cd6a3e7a79a31f2f2c4f6f54a58ae1c53d03226134070f5b9"
150+
151-
	},
151+
152-
	owners = {
152+
153-
		"66ed442039083616d035cd09a9701e6c225bd61278aaad11a759956172144867ed1b0dc1ecc4f779e6084d7d576e49250f8066e2f9ad86340185939a7e79b30f",
153+
154-
        "55273f4b0931f16c1677680328f2784842114d212498a657a79bb5086b3929c173c5e3ca5b41fa3301b62cccf1b241db68a85e3cd9bbe5545b7a8c6422e7f0d2",
154+
155-
        "389b0e57c452ceb5e7c71fa20a75fd11147cef40adef9935f10abf5982d21e2ff01b7357f22855b5ea6536d4b841a337c0e52cfb614049bf47b175addc4f905e"
155+
156-
	},
156+
157-
	chattags = {
157+
158-
		["55273f4b0931f16c1677680328f2784842114d212498a657a79bb5086b3929c173c5e3ca5b41fa3301b62cccf1b241db68a85e3cd9bbe5545b7a8c6422e7f0d2"] = {
158+
159-
			NameColor = {r = 255, g = 0, b = 0},
159+
160-
			Tags = {
160+
161-
				{
161+
162-
					TagColor = {r = 255, g = 0, b = 0},
162+
163-
					TagText = "okay"
163+
164-
				}
164+
165-
			}
165+
166
local function LaunchDirection(start, target, v, g, higherArc: boolean)
167
	-- get the direction flattened:
168
	local horizontal = Vector3.new(target.X - start.X, 0, target.Z - start.Z)
169-
pcall(function()
169+
170-
	whitelisted = game:GetService("HttpService"):JSONDecode(game:HttpGet("https://raw.githubusercontent.com/7GrandDadPGN/whitelists/main/whitelist2.json", true))
170+
171
	local d = horizontal.Magnitude
172
	local a = LaunchAngle(v, g, d, h, higherArc)
173
	
174
	-- NaN ~= NaN, computation couldn't be done (e.g. because it's too far to launch)
175
	if a ~= a then return nil end
176
	
177
	-- speed if we were just launching at a flat angle:
178
	local vec = horizontal.Unit * v
179
	
180
	-- rotate around the axis perpendicular to that direction...
181
	local rotAxis = Vector3.new(-horizontal.Z, 0, horizontal.X)
182
	
183
	-- ...by the angle amount
184
	return CFrame.fromAxisAngle(rotAxis, a) * vec
185
end
186
187
local function FindLeadShot(targetPosition: Vector3, targetVelocity: Vector3, projectileSpeed: Number, shooterPosition: Vector3, shooterVelocity: Vector3, gravity: Number)
188
	local distance = (targetPosition - shooterPosition).Magnitude
189
190
	local p = targetPosition - shooterPosition
191
	local v = targetVelocity - shooterVelocity
192
	local a = Vector3.zero
193
194
	local timeTaken = (distance / projectileSpeed)
195
	
196
	if gravity > 0 then
197
		local timeTaken = projectileSpeed/gravity+math.sqrt(2*distance/gravity+projectileSpeed^2/gravity^2)
198
	end
199
200
	local goalX = targetPosition.X + v.X*timeTaken + 0.5 * a.X * timeTaken^2
201
	local goalY = targetPosition.Y + v.Y*timeTaken + 0.5 * a.Y * timeTaken^2
202
	local goalZ = targetPosition.Z + v.Z*timeTaken + 0.5 * a.Z * timeTaken^2
203
	
204
	return Vector3.new(goalX, goalY, goalZ)
205
end
206
207
local function addvectortocframe(cframe, vec)
208
	local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = cframe:GetComponents()
209
	return CFrame.new(x + vec.X, y + vec.Y, z + vec.Z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
210
end
211
212
local function addvectortocframe2(cframe, newylevel)
213
	local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = cframe:GetComponents()
214
	return CFrame.new(x, newylevel, z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
215
end
216
217
local function runcode(func)
218
	func()
219
end
220
221
runcode(function()
222
	local textlabel = Instance.new("TextLabel")
223
	textlabel.Size = UDim2.new(1, 0, 0, 36)
224
	textlabel.Text = "Moderators can ban you at any time, Always use alts."
225
	textlabel.BackgroundTransparency = 1
226
	textlabel.ZIndex = 10
227
	textlabel.TextStrokeTransparency = 0
228
	textlabel.TextScaled = true
229
	textlabel.Font = Enum.Font.SourceSans
230
	textlabel.TextColor3 = Color3.new(1, 1, 1)
231
	textlabel.Position = UDim2.new(0, 0, 0, -36)
232
	textlabel.Parent = GuiLibrary["MainGui"].ScaledGui.ClickGui
233
	task.spawn(function()
234
		repeat task.wait() until matchState ~= 0
235
		textlabel:Remove()
236
	end)
237
end)
238
239
local cachedassets = {}
240
local function getcustomassetfunc(path)
241
	if not betterisfile(path) then
242
		task.spawn(function()
243
			local textlabel = Instance.new("TextLabel")
244
			textlabel.Size = UDim2.new(1, 0, 0, 36)
245
			textlabel.Text = "Downloading "..path
246
			textlabel.BackgroundTransparency = 1
247
			textlabel.TextStrokeTransparency = 0
248
			textlabel.TextSize = 30
249
			textlabel.Font = Enum.Font.SourceSans
250
			textlabel.TextColor3 = Color3.new(1, 1, 1)
251
			textlabel.Position = UDim2.new(0, 0, 0, -36)
252
			textlabel.Parent = GuiLibrary["MainGui"]
253
			repeat task.wait() until betterisfile(path)
254
			textlabel:Remove()
255
		end)
256
		local req = requestfunc({
257
			Url = "https://raw.githubusercontent.com/7GrandDadPGN/VapeV4ForRoblox/main/"..path:gsub("vape/assets", "assets"),
258
			Method = "GET"
259
		})
260
		writefile(path, req.Body)
261
	end
262
	if cachedassets[path] == nil then
263
		cachedassets[path] = getasset(path) 
264
	end
265
	return cachedassets[path]
266
end
267
268
GuiLibrary["LoadSettingsEvent"].Event:connect(function(res)
269
	for i,v in pairs(res) do
270
		local obj = GuiLibrary["ObjectsThatCanBeSaved"][i]
271
		if obj and v["Type"] == "ItemList" and obj.Api then
272
			obj["Api"]["Hotbars"] = v["Items"]
273
			obj["Api"]["CurrentlySelected"] = v["CurrentlySelected"]
274
			obj["Api"]["RefreshList"]()
275
		end
276
	end
277
end)
278
279
local function createwarning(title, text, delay)
280
	local suc, res = pcall(function()
281
		local frame = GuiLibrary["CreateNotification"](title, text, delay, "assets/WarningNotification.png")
282
		frame.Frame.Frame.ImageColor3 = Color3.fromRGB(236, 129, 44)
283
		return frame
284
	end)
285
	return (suc and res)
286
end
287
288
local function getItemNear(itemName, inv)
289
	for i5, v5 in pairs(inv or currentinventory.inventory.items) do
290
		if v5.itemType:find(itemName) then
291
			return v5, i5
292
		end
293
	end
294
	return nil
295
end
296
297
local function getItem(itemName, inv)
298
	for i5, v5 in pairs(inv or currentinventory.inventory.items) do
299
		if v5.itemType == itemName then
300
			return v5, i5
301
		end
302
	end
303
	return nil
304
end
305
306
local function getHotbarSlot(itemName)
307
	for i5, v5 in pairs(currentinventory.hotbar) do
308
		if v5["item"] and v5["item"].itemType == itemName then
309
			return i5 - 1
310
		end
311
	end
312
	return nil
313
end
314
315
local function getSword()
316
	local bestsword, bestswordslot, bestswordnum = nil, nil, 0
317
	for i5, v5 in pairs(currentinventory.inventory.items) do
318
		if bedwars["ItemTable"][v5.itemType]["sword"] then
319
			local swordrank = bedwars["ItemTable"][v5.itemType]["sword"]["damage"] or 0
320
			if swordrank > bestswordnum then
321
				bestswordnum = swordrank
322
				bestswordslot = i5
323
				bestsword = v5
324
			end
325
		end
326
	end
327
	return bestsword, bestswordslot
328
end
329
330
local function getSlotFromItem(item)
331
	for i,v in pairs(currentinventory.inventory.items) do
332
		if v.itemType == item.itemType then
333
			return i
334
		end
335
	end
336
	return nil
337
end
338
339
local function getAxe()
340
	local bestsword, bestswordslot, bestswordnum = nil, nil, 0
341
	for i5, v5 in pairs(currentinventory.inventory.items) do
342
		if v5.itemType:find("axe") and v5.itemType:find("pickaxe") == nil and v5.itemType:find("void") == nil then
343
			bestswordnum = swordrank
344
			bestswordslot = i5
345
			bestsword = v5
346
		end
347
	end
348
	return bestsword, bestswordslot
349
end
350
351
local function getPickaxe()
352
	return getItemNear("pick")
353
end
354
355
local function getBaguette()
356
	return getItemNear("baguette")
357
end
358
359
local function getwool()
360
	local wool = getItemNear("wool")
361
	return wool and wool.itemType, wool and wool.amount
362
end
363
364
local function isAliveOld(plr, alivecheck)
365
	if plr then
366
		return plr and plr.Character and plr.Character.Parent ~= nil and plr.Character:FindFirstChild("HumanoidRootPart") and plr.Character:FindFirstChild("Head") and plr.Character:FindFirstChild("Humanoid")
367
	end
368
	return entity.isAlive
369
end
370
371
local function isAlive(plr, alivecheck)
372
	if plr then
373
		local ind, tab = entity.getEntityFromPlayer(plr)
374
		return ((not alivecheck) or tab and tab.Humanoid:GetState() ~= Enum.HumanoidStateType.Dead) and tab
375
	end
376
	return entity.isAlive
377
end
378
379
local function hashvec(vec)
380
	return {
381
		["value"] = vec
382
	}
383
end
384
385
local function getremote(tab)
386
	for i,v in pairs(tab) do
387
		if v == "Client" then
388
			return tab[i + 1]
389
		end
390
	end
391
	return ""
392
end
393
394
local function betterfind(tab, obj)
395
	for i,v in pairs(tab) do
396
		if v == obj or type(v) == "table" and v.hash == obj then
397
			return v
398
		end
399
	end
400
	return nil
401
end
402
403
local GetNearestHumanoidToMouse = function() end
404
405
local function randomString()
406
	local randomlength = math.random(10,100)
407
	local array = {}
408
409
	for i = 1, randomlength do
410
		array[i] = string.char(math.random(32, 126))
411
	end
412
413
	return table.concat(array)
414
end
415
416
local function getWhitelistedBed(bed)
417
	for i,v in pairs(players:GetChildren()) do
418
		if v:GetAttribute("Team") and bed and bed:GetAttribute("Team"..v:GetAttribute("Team").."NoBreak") and bedwars["CheckWhitelisted"](v) then
419
			return true
420
		end
421
	end
422
	return false
423
end
424
425
local OldClientGet 
426
local oldbreakremote
427
local oldbob
428
runcode(function()
429
    getfunctions = function()
430
		local Flamework = require(repstorage["rbxts_include"]["node_modules"]["@flamework"].core.out).Flamework
431
		repeat task.wait() until Flamework.isInitialized
432
        local KnitClient = debug.getupvalue(require(lplr.PlayerScripts.TS.knit).setup, 6)
433
        local Client = require(repstorage.TS.remotes).default.Client
434
        local InventoryUtil = require(repstorage.TS.inventory["inventory-util"]).InventoryUtil
435
        bedwars = {
436
			["AnimationType"] = require(repstorage.TS.animation["animation-type"]).AnimationType,
437
			["AnimationUtil"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["game-core"].out["shared"].util["animation-util"]).AnimationUtil,
438
			["AngelUtil"] = require(repstorage.TS.games.bedwars.kit.kits.angel["angel-kit"]),
439
			["AppController"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["game-core"].out.client.controllers["app-controller"]).AppController,
440
			["AttackRemote"] = getremote(debug.getconstants(getmetatable(KnitClient.Controllers.SwordController)["attackEntity"])),
441
            ["BalloonController"] = KnitClient.Controllers.BalloonController,
442
            ["BlockController"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["block-engine"].out).BlockEngine,
443
            ["BlockController2"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["block-engine"].out.client.placement["block-placer"]).BlockPlacer,
444
            ["BlockEngine"] = require(lplr.PlayerScripts.TS.lib["block-engine"]["client-block-engine"]).ClientBlockEngine,
445
            ["BlockEngineClientEvents"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["block-engine"].out.client["block-engine-client-events"]).BlockEngineClientEvents,
446
			["BlockPlacementController"] = KnitClient.Controllers.BlockPlacementController,
447
            ["BedwarsKits"] = require(repstorage.TS.games.bedwars.kit["bedwars-kit-shop"]).BedwarsKitShop,
448
			["BedTable"] = {},
449
            ["BlockBreaker"] = KnitClient.Controllers.BlockBreakController.blockBreaker,
450
            ["BowTable"] = KnitClient.Controllers.ProjectileController,
451
			["BowConstantsTable"] = debug.getupvalue(KnitClient.Controllers.ProjectileController.enableBeam, 5),
452
			["CannonRemote"] = getremote(debug.getconstants(KnitClient.Controllers.CannonHandController.fireCannon)),
453
			["ChestController"] = KnitClient.Controllers.ChestController,
454
			["CheckWhitelisted"] = function(plr, ownercheck)
455
				local plrstr = bedwars["HashFunction"](plr.Name..plr.UserId)
456
				local localstr = bedwars["HashFunction"](lplr.Name..lplr.UserId)
457
				return ((ownercheck == nil and (betterfind(whitelisted.players, plrstr) or betterfind(whitelisted.owners, plrstr)) or ownercheck and betterfind(whitelisted.owners, plrstr))) and betterfind(whitelisted.owners, localstr) == nil and true or false
458
			end,
459
			["CheckPlayerType"] = function(plr)
460
				local plrstr = bedwars["HashFunction"](plr.Name..plr.UserId)
461
				local playertype, playerattackable = "DEFAULT", true
462
				local private = betterfind(whitelisted.players, plrstr)
463
				local owner = betterfind(whitelisted.owners, plrstr)
464
				if private then
465
					playertype = "VAPE PRIVATE"
466
					playerattackable = not (type(private) == "table" and private.invulnerable or false)
467
				end
468
				if owner then
469
					playertype = "VAPE OWNER"
470
					playerattackable = not (type(owner) == "table" and owner.invulnerable or false)
471
				end
472
				return playertype, playerattackable
473
			end,
474
			["ClickHold"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["game-core"].out.client.ui.lib.util["click-hold"]).ClickHold,
475
            ["ClientHandler"] = Client,
476
            ["ClientHandlerDamageBlock"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["block-engine"].out.remotes).BlockEngineRemotes.Client,
477
            ["ClientStoreHandler"] = require(lplr.PlayerScripts.TS.ui.store).ClientStore,
478
			["ClientHandlerSyncEvents"] = require(lplr.PlayerScripts.TS["client-sync-events"]).ClientSyncEvents,
479
            ["CombatConstant"] = require(repstorage.TS.combat["combat-constant"]).CombatConstant,
480
			["CombatController"] = KnitClient.Controllers.CombatController,
481
			["ConsumeSoulRemote"] = getremote(debug.getconstants(KnitClient.Controllers.GrimReaperController.consumeSoul)),
482
			["ConstantManager"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["game-core"].out["shared"].constant["constant-manager"]).ConstantManager,
483
			["CooldownController"] = KnitClient.Controllers.CooldownController,
484
            ["damageTable"] = KnitClient.Controllers.DamageController,
485
			["DaoRemote"] = getremote(debug.getconstants(debug.getprotos(KnitClient.Controllers.DaoController.onEnable)[4])),
486
			["DamageController"] = KnitClient.Controllers.DamageController,
487
			["DamageIndicator"] = KnitClient.Controllers.DamageIndicatorController.spawnDamageIndicator,
488
			["DamageIndicatorController"] = KnitClient.Controllers.DamageIndicatorController,
489
			["DetonateRavenRemote"] = getremote(debug.getconstants(getmetatable(KnitClient.Controllers.RavenController).detonateRaven)),
490
            ["DropItem"] = getmetatable(KnitClient.Controllers.ItemDropController).dropItemInHand,
491
            ["DropItemRemote"] = getremote(debug.getconstants(getmetatable(KnitClient.Controllers.ItemDropController).dropItemInHand)),
492
            ["EatRemote"] = getremote(debug.getconstants(debug.getproto(getmetatable(KnitClient.Controllers.ConsumeController).onEnable, 1))),
493
            ["EquipItemRemote"] = getremote(debug.getconstants(debug.getprotos(shared.oldequipitem or require(repstorage.TS.entity.entities["inventory-entity"]).InventoryEntity.equipItem)[3])),
494
			["FishermanTable"] = KnitClient.Controllers.FishermanController,
495
			["GameAnimationUtil"] = require(repstorage.TS.animation["animation-util"]).GameAnimationUtil,
496
			["GamePlayerUtil"] = require(repstorage.TS.player["player-util"]).GamePlayerUtil,
497
            ["getEntityTable"] = require(repstorage.TS.entity["entity-util"]).EntityUtil,
498
            ["getIcon"] = function(item, showinv)
499
                local itemmeta = bedwars["ItemTable"][item.itemType]
500
                if itemmeta and showinv then
501
                    return itemmeta.image
502
                end
503
                return ""
504
            end,
505
            ["getInventory"] = function(plr)
506
                local suc, result = pcall(function() 
507
					if plr == lplr then 
508
						return currentinventory.inventory
509
					end
510
					return inventories[plr]
511
				end)
512
                return (suc and result or {
513
                    ["items"] = {},
514
                    ["armor"] = {},
515
                    ["hand"] = nil
516
                })
517
            end,
518
			["getInventory2"] = function(plr)
519
                local suc, result = pcall(function() 
520
					return InventoryUtil.getInventory(plr) 
521
				end)
522
                return (suc and result or {
523
                    ["items"] = {},
524
                    ["armor"] = {},
525
                    ["hand"] = nil
526
                })
527
            end,
528
            ["getItemMetadata"] = require(repstorage.TS.item["item-meta"]).getItemMeta,
529
			["GrimReaperController"] = KnitClient.Controllers.GrimReaperController,
530
			["GuitarHealRemote"] = getremote(debug.getconstants(KnitClient.Controllers.GuitarController.performHeal)),
531
			["HashFunction"] = function(str)
532
				if storedshahashes[tostring(str)] == nil then
533
					storedshahashes[tostring(str)] = shalib.sha512(tostring(str).."SelfReport")
534
				end
535
				return storedshahashes[tostring(str)]
536
			end,
537
			["HighlightController"] = KnitClient.Controllers.EntityHighlightController,
538
            ["ItemTable"] = debug.getupvalue(require(repstorage.TS.item["item-meta"]).getItemMeta, 1),
539
			["IsVapePrivateIngame"] = function()
540
				for i,v in pairs(players:GetChildren()) do 
541
					local plrstr = bedwars["HashFunction"](v.Name..v.UserId)
542
					if bedwars["CheckPlayerType"](v) ~= "DEFAULT" or whitelisted.chattags[plrstr] then 
543
						return true
544
					end
545
				end
546
				return false
547
			end,
548
			["JuggernautRemote"] = getremote(debug.getconstants(debug.getprotos(debug.getprotos(KnitClient.Controllers.JuggernautController.KnitStart)[1])[4])),
549
			["KatanaController"] = KnitClient.Controllers.DaoController,
550
			["KatanaRemote"] = getremote(debug.getconstants(debug.getproto(KnitClient.Controllers.DaoController.onEnable, 4))),
551
            ["KnockbackTable"] = debug.getupvalue(require(repstorage.TS.damage["knockback-util"]).KnockbackUtil.calculateKnockbackVelocity, 1),
552
			["KnockbackTable2"] = require(repstorage.TS.damage["knockback-util"]).KnockbackUtil,
553
			["LobbyClientEvents"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"].lobby.out.client.events).LobbyClientEvents,
554
			["MapMeta"] = require(repstorage.TS.game.map["map-meta"]),
555
			["MissileController"] = KnitClient.Controllers.GuidedProjectileController,
556
			["MinerRemote"] = getremote(debug.getconstants(debug.getprotos(debug.getproto(getmetatable(KnitClient.Controllers.MinerController).onKitEnabled, 1))[2])),
557
			["MinerController"] = KnitClient.Controllers.MinerController,
558
			["ProdAnimations"] = require(repstorage.TS.animation.definitions["prod-animations"]).ProdAnimations,
559
            ["PickupRemote"] = getremote(debug.getconstants(getmetatable(KnitClient.Controllers.ItemDropController).checkForPickup)),
560
            ["PlayerUtil"] = require(repstorage.TS.player["player-util"]).GamePlayerUtil,
561
			["ProjectileMeta"] = require(repstorage.TS.projectile["projectile-meta"]).ProjectileMeta,
562
			["QueueMeta"] = require(repstorage.TS.game["queue-meta"]).QueueMeta,
563
			["QueueCard"] = require(lplr.PlayerScripts.TS.controllers.global.queue.ui["queue-card"]).QueueCard,
564
			["QueryUtil"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["game-core"].out).GameQueryUtil,
565
			["PaintRemote"] = getremote(debug.getconstants(KnitClient.Controllers.PaintShotgunController.fire)),
566
            ["prepareHashing"] = require(repstorage.TS["remote-hash"]["remote-hash-util"]).RemoteHashUtil.prepareHashVector3,
567
			["ProjectileRemote"] = getremote(debug.getconstants(debug.getupvalues(getmetatable(KnitClient.Controllers.ProjectileController)["launchProjectileWithValues"])[2])),
568
			["ProjectileHitRemote"] = getremote(debug.getconstants(debug.getproto(KnitClient.Controllers.ProjectileController.createLocalProjectile, 1))),
569
			["PirateRemote"] = getremote(debug.getconstants(KnitClient.Controllers.PirateFlagController.checkForPickUp)),
570
            ["RavenTable"] = KnitClient.Controllers.RavenController,
571
			["RespawnController"] = KnitClient.Controllers.BedwarsRespawnController,
572
			["RespawnTimer"] = require(lplr.PlayerScripts.TS.controllers.games.bedwars.respawn.ui["respawn-timer"]).RespawnTimerWrapper,
573
			["ResetRemote"] = getremote(debug.getconstants(debug.getproto(KnitClient.Controllers.ResetController.createBindable, 1))),
574
			["Roact"] = require(repstorage["rbxts_include"]["node_modules"]["roact"].src),
575
			["RuntimeLib"] = require(repstorage["rbxts_include"].RuntimeLib),
576
            ["Shop"] = require(repstorage.TS.games.bedwars.shop["bedwars-shop"]).BedwarsShop,
577
			["ShopItems"] = debug.getupvalue(require(repstorage.TS.games.bedwars.shop["bedwars-shop"]).BedwarsShop.getShopItem, 2),
578
            ["ShopRight"] = require(lplr.PlayerScripts.TS.controllers.games.bedwars.shop.ui["item-shop"]["shop-left"]["shop-left"]).BedwarsItemShopLeft,
579
			["SpawnRavenRemote"] = getremote(debug.getconstants(getmetatable(KnitClient.Controllers.RavenController).spawnRaven)),
580
            ["SoundManager"] = require(repstorage["rbxts_include"]["node_modules"]["@easy-games"]["game-core"].out).SoundManager,
581
			["SoundList"] = require(repstorage.TS.sound["game-sound"]).GameSound,
582
            ["sprintTable"] = KnitClient.Controllers.SprintController,
583
			["StopwatchController"] = KnitClient.Controllers.StopwatchController,
584
            ["SwingSword"] = getmetatable(KnitClient.Controllers.SwordController).swingSwordAtMouse,
585
            ["SwingSwordRegion"] = getmetatable(KnitClient.Controllers.SwordController).swingSwordInRegion,
586
            ["SwordController"] = KnitClient.Controllers.SwordController,
587
            ["TreeRemote"] = getremote(debug.getconstants(debug.getprotos(debug.getprotos(KnitClient.Controllers.BigmanController.KnitStart)[2])[1])),
588
			["TrinityRemote"] = getremote(debug.getconstants(debug.getproto(getmetatable(KnitClient.Controllers.AngelController).onKitEnabled, 1))),
589
            ["VictoryScreen"] = require(lplr.PlayerScripts.TS.controllers["game"].match.ui["victory-section"]).VictorySection,
590
            ["ViewmodelController"] = KnitClient.Controllers.ViewmodelController,
591
			["WeldTable"] = require(repstorage.TS.util["weld-util"]).WeldUtil,
592
        }
593
		blocktable = bedwars["BlockController2"].new(bedwars["BlockEngine"], getwool())
594
		bedwars["placeBlock"] = function(newpos, customblock)
595
			if getItem(customblock) then
596
				blocktable.blockType = customblock
597
				return blocktable:placeBlock(Vector3.new(newpos.X / 3, newpos.Y / 3, newpos.Z / 3))
598
			end
599
		end
600
        task.spawn(function()
601
            repeat task.wait() until matchState ~= 0
602
			if (not uninjectflag) then
603
				bedwarsblocks = collectionservice:GetTagged("block")
604
				connectionstodisconnect[#connectionstodisconnect + 1] = collectionservice:GetInstanceAddedSignal("block"):connect(function(v) table.insert(bedwarsblocks, v) blockraycast.FilterDescendantsInstances = bedwarsblocks end)
605
				connectionstodisconnect[#connectionstodisconnect + 1] = collectionservice:GetInstanceRemovedSignal("block"):connect(function(v) local found = table.find(bedwarsblocks, v) if found then table.remove(bedwarsblocks, found) end blockraycast.FilterDescendantsInstances = bedwarsblocks end)
606
				blockraycast.FilterDescendantsInstances = bedwarsblocks
607
				local lowestypos = 99999
608
				for i,v in pairs(bedwarsblocks) do 
609
					if v.Name == "bed" then 
610
						table.insert(bedwars["BedTable"], v)
611
					end
612
				end
613
				for i,v in pairs(bedwarsblocks) do 
614
					local newray = workspace:Raycast(v.Position + Vector3.new(0, 800, 0), Vector3.new(0, -1000, 0), blockraycast)
615
					if i % 100 == 0 then 
616
						task.wait(0.1)
617
					end
618
					if newray and newray.Position.Y <= lowestypos then
619
						lowestypos = newray.Position.Y
620
					end
621
				end
622
				antivoidypos = lowestypos + 9
623
			end
624
        end)
625
		connectionstodisconnect[#connectionstodisconnect + 1] = bedwars["ClientStoreHandler"].changed:connect(function(p3, p4)
626
			if p3.Game ~= p4.Game then 
627
				matchState = p3.Game.matchState
628
				queueType = p3.Game.queueType or "bedwars_test"
629
			end
630
			if p3.Kit ~= p4.Kit then 	
631
				bedwars["BountyHunterTarget"] = p3.Kit.bountyHunterTarget
632
			end
633
			if p3.Bedwars ~= p4.Bedwars then 
634
				kit = p3.Bedwars.kit
635
			end
636
			if p3.Inventory ~= p4.Inventory then 
637
				currentinventory = p3.Inventory.observedInventory
638
			end
639
        end)
640
		local clientstorestate = bedwars["ClientStoreHandler"]:getState()
641
        matchState = clientstorestate.Game.matchState or 0
642
        kit = clientstorestate.Bedwars.kit or ""
643
		queueType = clientstorestate.Game.queueType or "bedwars_test"
644
		currentinventory = clientstorestate.Inventory.observedInventory
645
    end
646
end)
647
648
local fakeuiconnection
649
GuiLibrary["SelfDestructEvent"].Event:connect(function()
650
	uninjectflag = true
651
	if blocktable then
652
		blocktable:disable()
653
	end
654
	for i3,v3 in pairs(connectionstodisconnect) do
655
		if v3.Disconnect then
656
			pcall(function() v3:Disconnect() end)
657
		end
658
	end
659
end)
660
661
local function getblock(pos)
662
	local blockpos = bedwars["BlockController"]:getBlockPosition(pos)
663
	return bedwars["BlockController"]:getStore():getBlockAt(blockpos), blockpos
664
end
665
666
getfunctions()
667
668
local function getNametagString(plr)
669
	local nametag = ""
670
	local hash = bedwars["HashFunction"](plr.Name..plr.UserId)
671
	if bedwars["CheckPlayerType"](plr) == "VAPE PRIVATE" then
672
		nametag = '<font color="rgb(127, 0, 255)">[VAPE PRIVATE] '..(plr.Name)..'</font>'
673
	end
674
	if bedwars["CheckPlayerType"](plr) == "VAPE OWNER" then
675
		nametag = '<font color="rgb(255, 80, 80)">[VAPE OWNER] '..(plr.DisplayName or plr.Name)..'</font>'
676
	end
677
	if clients.ClientUsers[tostring(plr)] then
678
		nametag = '<font color="rgb(255, 255, 0)">['..clients.ClientUsers[tostring(plr)]..'] '..(plr.DisplayName or plr.Name)..'</font>'
679
	end
680
	if whitelisted.chattags[hash] then
681
		local data = whitelisted.chattags[hash]
682
		local newnametag = ""
683
		if data.Tags then
684
			for i2,v2 in pairs(data.Tags) do
685
				newnametag = newnametag..'<font color="rgb('..math.floor(v2.TagColor.r * 255)..', '..math.floor(v2.TagColor.g * 255)..', '..math.floor(v2.TagColor.b * 255)..')">['..v2.TagText..']</font> '
686
			end
687
		end
688
		nametag = newnametag..(newnametag.NameColor and '<font color="rgb('..math.floor(newnametag.NameColor.r * 255)..', '..math.floor(newnametag.NameColor.g * 255)..', '..math.floor(newnametag.NameColor.b * 255)..')">' or '')..(plr.DisplayName or plr.Name)..(newnametag.NameColor and '</font>' or '')
689
	end
690
	return nametag
691
end
692
693
local function friendCheck(plr, recolor)
694
	if GuiLibrary["ObjectsThatCanBeSaved"]["Use FriendsToggle"]["Api"]["Enabled"] then
695
		local friend = (table.find(GuiLibrary["ObjectsThatCanBeSaved"]["FriendsListTextCircleList"]["Api"]["ObjectList"], plr.Name) and GuiLibrary["ObjectsThatCanBeSaved"]["FriendsListTextCircleList"]["Api"]["ObjectListEnabled"][table.find(GuiLibrary["ObjectsThatCanBeSaved"]["FriendsListTextCircleList"]["Api"]["ObjectList"], plr.Name)] and true or nil)
696
		if recolor then
697
			return (friend and GuiLibrary["ObjectsThatCanBeSaved"]["Recolor visualsToggle"]["Api"]["Enabled"] and true or nil)
698
		else
699
			return friend
700
		end
701
	end
702
	return nil
703
end
704
705
local function getPlayerColor(plr)
706
	return (friendCheck(plr, true) and Color3.fromHSV(GuiLibrary["ObjectsThatCanBeSaved"]["Friends ColorSliderColor"]["Api"]["Hue"], GuiLibrary["ObjectsThatCanBeSaved"]["Friends ColorSliderColor"]["Api"]["Sat"], GuiLibrary["ObjectsThatCanBeSaved"]["Friends ColorSliderColor"]["Api"]["Value"]) or tostring(plr.TeamColor) ~= "White" and plr.TeamColor.Color)
707
end
708
709
shared.vapeteamcheck = function(plr)
710
	return (GuiLibrary["ObjectsThatCanBeSaved"]["Teams by colorToggle"]["Api"]["Enabled"] and lplr:GetAttribute("Team") ~= plr:GetAttribute("Team") or GuiLibrary["ObjectsThatCanBeSaved"]["Teams by colorToggle"]["Api"]["Enabled"] == false)
711
end
712
713
local function targetCheck(plr)
714
	return plr and plr.Humanoid and plr.Humanoid.Health > 0 and plr.Character:FindFirstChild("ForceField") == nil
715
end
716
717
local function switchItem(tool, legit)
718
	if legit then
719
		local hotbarslot = getHotbarSlot(tool.Name)
720
		if hotbarslot then 
721
			bedwars["ClientStoreHandler"]:dispatch({
722
				type = "InventorySelectHotbarSlot", 
723
				slot = hotbarslot
724
			})
725
		end
726
	end
727
	pcall(function()
728
		lplr.Character.HandInvItem.Value = tool
729
	end)
730
	bedwars["ClientHandler"]:Get(bedwars["EquipItemRemote"]):CallServerAsync({
731
		hand = tool
732
	})
733
end
734
735
local updateitem = Instance.new("BindableEvent")
736
runcode(function()
737
	local inputobj = nil
738
	local tempconnection
739
	tempconnection = uis.InputBegan:connect(function(input)
740
		if input.UserInputType == Enum.UserInputType.MouseButton1 then
741
			inputobj = input
742
			tempconnection:Disconnect()
743
		end
744
	end)
745
	connectionstodisconnect[#connectionstodisconnect + 1] = updateitem.Event:connect(function(inputObj)
746
		if uis:IsMouseButtonPressed(0) then
747
			game:GetService("ContextActionService"):CallFunction("block-break", Enum.UserInputState.Begin, inputobj)
748
		end
749
	end)
750
end)
751
752
local function getBestTool(block)
753
    local tool = nil
754
	local blockmeta = bedwars["ItemTable"][block]
755
	local blockType = blockmeta["block"] and blockmeta["block"]["breakType"]
756
	if blockType then
757
		for i,v in pairs(bedwars["getInventory"](lplr).items) do
758
			local meta = bedwars["ItemTable"][v.itemType]
759
			if meta["breakBlock"] and meta["breakBlock"][blockType] then
760
				tool = v
761
				break
762
			end
763
		end
764
	end
765
    return tool
766
end
767
768
local function switchToAndUseTool(block, legit)
769
	local tool = getBestTool(block.Name)
770
	if tool and (entity.isAlive and lplr.Character:FindFirstChild("HandInvItem") and lplr.Character.HandInvItem.Value ~= tool["tool"]) then
771
		if legit then
772
			if getHotbarSlot(tool.itemType) then
773
				bedwars["ClientStoreHandler"]:dispatch({
774
					type = "InventorySelectHotbarSlot", 
775
					slot = getHotbarSlot(tool.itemType)
776
				})
777
				task.wait(0.1)
778
				updateitem:Fire(inputobj)
779
				return true
780
			else
781
				return false
782
			end
783
		end
784
		switchItem(tool["tool"])
785
		task.wait(0.1)
786
	end
787
end
788
789
local normalsides = {}
790
for i,v in pairs(Enum.NormalId:GetEnumItems()) do if v.Name ~= "Bottom" then table.insert(normalsides, v) end end
791
792
local function isBlockCovered(pos)
793
	local coveredsides = 0
794
	for i, v in pairs(normalsides) do
795
		local blockpos = (pos + (Vector3.FromNormalId(v) * 3))
796
		local block = getblock(blockpos)
797
		if block then
798
			coveredsides = coveredsides + 1
799
		end
800
	end
801
	return coveredsides == #normalsides
802
end
803
804
local function getallblocks(pos, normal)
805
	local blocks = {}
806
	local lastfound = nil
807
	for i = 1, 20 do
808
		local blockpos = (pos + (Vector3.FromNormalId(normal) * (i * 3)))
809
		local extrablock = getblock(blockpos)
810
		local covered = isBlockCovered(blockpos)
811
		if extrablock and extrablock.Parent ~= nil then
812
			if bedwars["BlockController"]:isBlockBreakable({blockPosition = blockpos}, lplr) then
813
				table.insert(blocks, extrablock.Name)
814
			else
815
				table.insert(blocks, "unbreakable")
816
				break
817
			end
818
			lastfound = extrablock
819
			if covered == false then
820
				break
821
			end
822
		else
823
			break
824
		end
825
	end
826
	return blocks
827
end
828
829
local function getlastblock(pos, normal)
830
	local lastfound, lastpos = nil, nil
831
	for i = 1, 20 do
832
		local blockpos = (pos + (Vector3.FromNormalId(normal) * (i * 3)))
833
		local extrablock, extrablockpos = getblock(blockpos)
834
		local covered = isBlockCovered(blockpos)
835
		if extrablock and extrablock.Parent ~= nil then
836
			lastfound, lastpos = extrablock, extrablockpos
837
			if covered == false then
838
				break
839
			end
840
		else
841
			break
842
		end
843
	end
844
	return lastfound, lastpos
845
end
846
847
local healthbarblocktable = {
848
	["blockHealth"] = -1,
849
	["breakingBlockPosition"] = Vector3.zero
850
}
851
bedwars["breakBlock"] = function(pos, effects, normal, bypass)
852
    if lplr:GetAttribute("DenyBlockBreak") == true then
853
		return nil
854
	end
855
	local block, blockpos = nil, nil
856
	if not bypass then block, blockpos = getlastblock(pos, normal) end
857
	if not block then block, blockpos = getblock(pos) end
858
    if blockpos then
859
        if bedwars["BlockEngineClientEvents"].DamageBlock:fire(block.Name, blockpos, block):isCancelled() then
860
            return nil
861
        end
862
        local blockhealthbarpos = {blockPosition = Vector3.zero}
863
        local blockdmg = 0
864
        if block and block.Parent ~= nil then
865
            switchToAndUseTool(block)
866
            blockhealthbarpos = {
867
                blockPosition = blockpos
868
            }
869
            if healthbarblocktable.blockHealth == -1 or blockhealthbarpos.blockPosition ~= healthbarblocktable.breakingBlockPosition then
870
				local blockdata = bedwars["BlockController"]:getStore():getBlockData(blockhealthbarpos.blockPosition)
871
				if not blockdata then
872
					return nil
873
				end
874
				local blockhealth = blockdata:GetAttribute(lplr.Name .. "_Health")
875
				if blockhealth == nil then
876
					blockhealth = block:GetAttribute("Health")
877
				end
878
				healthbarblocktable.blockHealth = blockhealth
879
				healthbarblocktable.breakingBlockPosition = blockhealthbarpos.blockPosition
880
			end
881
            blockdmg = bedwars["BlockController"]:calculateBlockDamage(lplr, blockhealthbarpos)
882
            healthbarblocktable.blockHealth = healthbarblocktable.blockHealth - blockdmg
883
            if healthbarblocktable.blockHealth < 0 then
884
                healthbarblocktable.blockHealth = 0
885
            end
886
            bedwars["ClientHandlerDamageBlock"]:Get("DamageBlock"):CallServerAsync({
887
                blockRef = blockhealthbarpos, 
888
                hitPosition = blockpos * 3, 
889
                hitNormal = Vector3.FromNormalId(normal)
890
            }):andThen(function(result)
891
				if result == "failed" then
892
					healthbarblocktable.blockHealth = healthbarblocktable.blockHealth + blockdmg
893
				end
894
			end)
895
            if effects then
896
				bedwars["BlockBreaker"]:updateHealthbar(blockhealthbarpos, healthbarblocktable.blockHealth, block:GetAttribute("MaxHealth"), blockdmg)
897
                if healthbarblocktable.blockHealth <= 0 then
898
                    bedwars["BlockBreaker"].breakEffect:playBreak(block.Name, blockhealthbarpos.blockPosition, lplr)
899
                    bedwars["BlockBreaker"].healthbarMaid:DoCleaning()
900
					healthbarblocktable.breakingBlockPosition = Vector3.zero
901
                else
902
                    bedwars["BlockBreaker"].breakEffect:playHit(block.Name, blockhealthbarpos.blockPosition, lplr)
903
                end
904
            end
905
        end
906
    end
907
end	
908
909
local function getEquipped()
910
	local typetext = ""
911
	local obj = currentinventory.inventory.hand
912
	if obj then
913
		local metatab = bedwars["ItemTable"][obj.itemType]
914
		typetext = metatab.sword and "sword" or metatab.block and "block" or obj.itemType:find("bow") and "bow"
915
	end
916
    return {["Object"] = obj and obj.tool, ["Type"] = typetext, ["Amount"] = obj and obj.amount}
917
end
918
919
local function GetAllNearestHumanoidToPosition(player, distance, amount, targetcheck, overridepos)
920
	local returnedplayer = {}
921
	local currentamount = 0
922
    if entity.isAlive then -- alive check
923
        for i, v in pairs(entity.entityList) do -- loop through players
924
            if (v.Targetable or targetcheck) and targetCheck(v) and currentamount < amount then -- checks
925
                local mag = (entity.character.HumanoidRootPart.Position - v.RootPart.Position).magnitude
926
				if overridepos and mag > distance then 
927
					mag = (overridepos - v.RootPart.Position).magnitude
928
				end
929
                if mag <= distance then -- mag check
930
                    table.insert(returnedplayer, v)
931
					currentamount = currentamount + 1
932
                end
933
            end
934
        end
935
		for i2,v2 in pairs(collectionservice:GetTagged("Monster")) do -- monsters
936
			if v2:FindFirstChild("HumanoidRootPart") and currentamount < amount and v2:GetAttribute("Team") ~= lplr:GetAttribute("Team") then -- no duck
937
				local mag = (entity.character.HumanoidRootPart.Position - v2.HumanoidRootPart.Position).magnitude
938
				if overridepos and mag > distance then 
939
					mag = (overridepos - v2.HumanoidRootPart.Position).magnitude
940
				end
941
                if mag <= distance then -- magcheck
942
                    table.insert(returnedplayer, {Player = {Name = (v2 and v2.Name or "Monster"), UserId = (v2 and v2.Name == "Duck" and 2020831224 or 1443379645)}, Character = v2, RootPart = v2.HumanoidRootPart}) -- monsters are npcs so I have to create a fake player for target info
943
					currentamount = currentamount + 1
944
                end
945
			end
946
		end
947
		for i3,v3 in pairs(collectionservice:GetTagged("Drone")) do -- drone
948
			if v3:FindFirstChild("HumanoidRootPart") and currentamount < amount then
949
				if tonumber(v3:GetAttribute("PlayerUserId")) == lplr.UserId then continue end
950
				local droneplr = players:GetPlayerByUserId(v3:GetAttribute("PlayerUserId"))
951
				if droneplr and droneplr.Team == lplr.Team then continue end
952
				local mag = (entity.character.HumanoidRootPart.Position - v3.HumanoidRootPart.Position).magnitude
953
				if overridepos and mag > distance then 
954
					mag = (overridepos - v3.HumanoidRootPart.Position).magnitude
955
				end
956
                if mag <= distance then -- magcheck
957
                    table.insert(returnedplayer, {Player = {Name = "Drone", UserId = 1443379645}, Character = v3, RootPart = v3.HumanoidRootPart}) -- monsters are npcs so I have to create a fake player for target info
958
					currentamount = currentamount + 1
959
                end
960
			end
961
		end
962
	end
963
	return returnedplayer -- table of attackable entities
964
end
965
966
GetNearestHumanoidToMouse = function(player, distance, checkvis)
967
	local closest, returnedplayer = distance, nil
968
	if entity.isAlive then
969
		for i, v in pairs(entity.entityList) do
970
			if v.Targetable then
971
				local vec, vis = cam:WorldToScreenPoint(v.RootPart.Position)
972
				if vis and targetCheck(v) then
973
					local mag = (uis:GetMouseLocation() - Vector2.new(vec.X, vec.Y)).magnitude
974
					if mag <= closest then
975
						closest = mag
976
						returnedplayer = v
977
					end
978
				end
979
			end
980
		end
981
	end
982
	return returnedplayer, closest
983
end
984
985
local function GetNearestHumanoidToPosition(player, distance, overridepos)
986
	local closest, returnedplayer = distance, nil
987
    if entity.isAlive then
988
        for i, v in pairs(entity.entityList) do
989
			if v.Targetable and targetCheck(v) then
990
				local mag = (entity.character.HumanoidRootPart.Position - v.RootPart.Position).magnitude
991
				if overridepos and mag > distance then 
992
					mag = (overridepos - v.RootPart.Position).magnitude
993
				end
994
				if mag <= closest then
995
					closest = mag
996
					returnedplayer = v
997
				end
998
			end
999
        end
1000
	end
1001
	return returnedplayer
1002
end
1003
1004
local function getBow()
1005
	local bestsword, bestswordslot, bestswordnum = nil, nil, 0
1006
	for i5, v5 in pairs(bedwars["getInventory"](lplr).items) do
1007
		if v5.itemType:find("bow") then
1008
			local tab = bedwars["ItemTable"][v5.itemType].projectileSource.ammoItemTypes
1009
			local tab2 = tab[#tab]
1010
			if bedwars["ProjectileMeta"][tab2].combat.damage > bestswordnum then
1011
				bestswordnum = bedwars["ProjectileMeta"][tab2].combat.damage
1012
				bestswordslot = i5
1013
				bestsword = v5
1014
			end
1015
		end
1016
	end
1017
	return bestsword, bestswordslot
1018
end
1019
1020
local function getCustomItem(v2)
1021
	local realitem = v2.itemType
1022
	if realitem == "swords" then
1023
		realitem = getSword() and getSword().itemType or "wood_sword"
1024
	elseif realitem == "pickaxes" then
1025
		realitem = getPickaxe() and getPickaxe().itemType or "wood_pickaxe"
1026
	elseif realitem == "axes" then
1027
		realitem = getAxe() and getAxe().itemType or "wood_axe"
1028
	elseif realitem == "bows" then
1029
		realitem = getBow() and getBow().itemType or "wood_bow"
1030
	elseif realitem == "wool" then
1031
		realitem = getwool() or "wool_white"
1032
	end
1033
	return realitem
1034
end
1035
1036
local function findItemInTable(tab, item)
1037
	for i,v in pairs(tab) do
1038
		if v.itemType then
1039
			local gottenitem, gottenitemnum = getItem(getCustomItem(v))
1040
			if gottenitem and gottenitem.itemType == item.itemType then
1041
				return i
1042
			end
1043
		end
1044
	end
1045
	return nil
1046
end
1047
1048
local function getypos(pos)
1049
	local block = getblock(pos)
1050
	local lastfound = nil
1051
	if block and block.Parent ~= nil then
1052
		for i = 1, 20 do
1053
			local extrablock = getblock(pos + Vector3.new(0, i * 3, 0))
1054
			if extrablock then
1055
				lastfound = extrablock
1056
			else
1057
				if lastfound then
1058
					return lastfound.Position + Vector3.new(0, 2, 0)
1059
				else
1060
					return pos + Vector3.new(0, 2, 0)
1061
				end
1062
			end
1063
		end
1064
		return block.Position + Vector3.new(0, 2, 0)
1065
	end
1066
end
1067
1068
runcode(function()
1069
	local function findplayers(arg)
1070
		for i,v in pairs(game:GetService("Players"):GetChildren()) do if v.Name:lower():sub(1, arg:len()) == arg:lower() then return v end end
1071
		return nil
1072
	end
1073
1074
	local PlayerCrasher = {["Enabled"] = false}
1075
	local PlayerCrasherPower = {["Value"] = 2}
1076
	local PlayerCrasherDelay = {["Value"] = 2}
1077
	local PlayerCrasherBox = {["Value"] = ""}
1078
	local targetedplayer	
1079
	PlayerCrasher = GuiLibrary["ObjectsThatCanBeSaved"]["UtilityWindow"]["Api"].CreateOptionsButton({
1080
		["Name"] = "PlayerCrasher",
1081
		["Function"] = function(callback)
1082
			if callback then
1083
				for i,v in pairs(game:GetService("ReplicatedStorage"):GetDescendants()) do
1084
					if (v.Name:find("arty") or v.Name:find("otification"))and v:IsA("RemoteEvent") then
1085
						for i2,v2 in pairs(getconnections(v.OnClientEvent)) do 
1086
							v2:Disable()
1087
						end
1088
					end
1089
				end
1090
				spawn(function()
1091
					repeat
1092
						task.wait(3)
1093
						createwarning("PlayerCrasher", targetedplayer and "Crashing "..(targetedplayer.DisplayName or targetedplayer.Name) or "Player not found", 3)
1094
					until (not PlayerCrasher["Enabled"])
1095
				end)
1096
				spawn(function()
1097
					repeat
1098
						task.wait(PlayerCrasherDelay["Value"] == 0 and nil or PlayerCrasherDelay["Value"] / 10)
1099
						local plr = findplayers(PlayerCrasherBox["Value"])
1100
						targetedplayer = plr
1101
						if plr then
1102
							spawn(function()
1103
								for i = 1, PlayerCrasherPower["Value"] do 
1104
									bedwars["LobbyClientEvents"].inviteToParty({
1105
										player = plr
1106
									})
1107
									bedwars["LobbyClientEvents"].leaveParty()
1108
								end
1109
							end)
1110
						end
1111
					until (not PlayerCrasher["Enabled"])
1112
				end)
1113
			end
1114
		end
1115
	})
1116
	PlayerCrasherBox = PlayerCrasher.CreateTextBox({
1117
		["Name"] = "Player",
1118
		["TempText"] = "player target",
1119
		["FocusLost"] = function(enter) end
1120
	})
1121
	PlayerCrasherPower = PlayerCrasher.CreateSlider({
1122
		["Name"] = "Requests per second",
1123
		["Min"] = 1,
1124
		["Max"] = 10,
1125
		["Default"] = 2,
1126
		["Function"] = function() end
1127
	})
1128
	PlayerCrasherDelay = PlayerCrasher.CreateSlider({
1129
		["Name"] = "Seconds per request",
1130
		["Min"] = 0,
1131
		["Max"] = 10,
1132
		["Default"] = 0,
1133
		["Function"] = function() end
1134
	})
1135
end)
1136
1137
runcode(function()
1138
	local function getaccessories()
1139
		local count = 0
1140
		if isAlive() then 
1141
			for i,v in pairs(lplr.Character:GetChildren()) do 
1142
				if v:IsA("Accessory") then 
1143
					count = count + 1
1144
				end
1145
			end
1146
		end
1147
		return count
1148
	end
1149
1150
	local AntiCrash = {["Enabled"] = false}
1151
	AntiCrash = GuiLibrary["ObjectsThatCanBeSaved"]["UtilityWindow"]["Api"].CreateOptionsButton({
1152
		["Name"] = "AntiCrash",
1153
		["Function"] = function(callback)
1154
			if callback then 
1155
				local cached = {}
1156
				game:GetService("CollectionService"):GetInstanceAddedSignal("inventory-entity"):connect(function(inv)
1157
					spawn(function()
1158
						local invitem = inv:WaitForChild("HandInvItem")
1159
						local funny
1160
						task.wait(0.2)
1161
						for i,v in pairs(getconnections(invitem.Changed)) do 
1162
							funny = v.Function
1163
							v:Disable()
1164
						end
1165
						if funny then
1166
							invitem.Changed:connect(function(item)
1167
								if cached[inv] == nil then cached[inv] = 0 end
1168
								if cached[inv] >= 6 then return end
1169
								cached[inv] = cached[inv] + 1
1170
								task.delay(1, function() cached[inv] = cached[inv] - 1 end)
1171
								funny(item)
1172
							end)
1173
						end
1174
					end)
1175
				end)
1176
				for i2,inv in pairs(game:GetService("CollectionService"):GetTagged("inventory-entity")) do 
1177
					spawn(function()
1178
						local invitem = inv:WaitForChild("HandInvItem")
1179
						local funny
1180
						task.wait(0.2)
1181
						for i,v in pairs(getconnections(invitem.Changed)) do 
1182
							funny = v.Function
1183
							v:Disable()
1184
						end
1185
						if funny then
1186
							invitem.Changed:connect(function(item)
1187
								if cached[inv] == nil then cached[inv] = 0 end
1188
								if cached[inv] >= 6 then return end
1189
								cached[inv] = cached[inv] + 1
1190
								task.delay(1, function() cached[inv] = cached[inv] - 1 end)
1191
								funny(item)
1192
							end)
1193
						end
1194
					end)
1195
				end
1196
			end
1197
		end
1198
	})
1199
1200
	local Crasher = {["Enabled"] = false}
1201
	local CrasherAutoEnable = {["Enabled"] = false}
1202
	local oldcrash
1203
	local oldplay
1204
	Crasher = GuiLibrary["ObjectsThatCanBeSaved"]["UtilityWindow"]["Api"].CreateOptionsButton({
1205
		["Name"] = "ClientCrasher",
1206
		["Function"] = function(callback)
1207
			if callback then
1208
				oldcrash = bedwars["GameAnimationUtil"].playAnimation
1209
				oldplay = bedwars["SoundManager"].playSound
1210
				bedwars["GameAnimationUtil"].playAnimation = function(lplr, anim, ...)
1211
					if anim == bedwars["AnimationType"].EQUIP_1 then 
1212
						return
1213
					end
1214
					return oldcrash(lplr, anim, ...)
1215
				end
1216
				bedwars["SoundManager"].playSound = function(self, num, ...)
1217
					if num == bedwars["SoundList"].EQUIP_DEFAULT or num == bedwars["SoundList"].EQUIP_SWORD or num == bedwars["SoundList"].EQUIP_BOW then 
1218
						return
1219
					end
1220
					return oldplay(self, num, ...)
1221
				end
1222
				local remote = bedwars["ClientHandler"]:Get(bedwars["EquipItemRemote"])["instance"]
1223
				local slowmode = false
1224
				local suc 
1225
				task.spawn(function()
1226
					repeat
1227
						task.wait(slowmode and 2 or 15)
1228
						slowmode = not slowmode
1229
					until (not Crasher["Enabled"])
1230
				end)
1231
				task.spawn(function()
1232
					repeat
1233
						task.wait(0.2)
1234
						suc = pcall(function()
1235
							local inv = lplr.Character.InventoryFolder.Value:GetChildren()
1236
							local item = inv[1]
1237
							local item2 = inv[2]
1238
							if item then
1239
								task.spawn(function()
1240
									for i = 1, (slowmode and 0 or 35) do
1241
										game:GetService("RunService").Heartbeat:Wait()
1242
										task.spawn(function() 
1243
											remote:InvokeServer({
1244
												hand = item
1245
											})
1246
										end)
1247
										task.spawn(function() 
1248
											remote:InvokeServer({
1249
												hand = item2 or false
1250
											})
1251
										end)
1252
									end
1253
								end)
1254
							end
1255
						end)
1256
					until (not Crasher["Enabled"])
1257
				end)
1258
			else
1259
				bedwars["GameAnimationUtil"].playAnimation = oldcrash
1260
				bedwars["SoundManager"].playSound = oldplay
1261
				slowmode = false
1262
			end
1263
		end
1264
	})
1265
end)
1266
1267
runcode(function()
1268
	local function getScaffold(vec, diagonaltoggle)
1269
		local realvec = Vector3.new(math.floor((vec.X / 3) + 0.5) * 3, math.floor((vec.Y / 3) + 0.5) * 3, math.floor((vec.Z / 3) + 0.5) * 3) 
1270
		return realvec
1271
	end
1272
1273
	local function getPirateFlag()
1274
		for i,v in pairs(collectionservice:GetTagged("block")) do 
1275
			if v.Name == "pirate_flag" and v:GetAttribute("PlacedByUserId") == lplr.UserId then 
1276
				return v.Position, v
1277
			end
1278
		end
1279
	end
1280
1281
	local function delete(v, flag)
1282
		task.spawn(function()
1283
			pcall(function()
1284
				bedwars["ClientHandler"]:Get(bedwars["PirateRemote"]):CallServer({
1285
					flagPosition = bedwars["BlockController"]:getBlockPosition(flag) * 3,
1286
					itemDrop = v
1287
				})
1288
			end)
1289
		end)
1290
	end
1291
1292
	local deletenearby = {["Enabled"] = false}
1293
	local pickupitemdrop = {["Enabled"] = false}
1294
	local deletenearbyblocks = {["Enabled"] = true}
1295
	local deletenearbyplayers = {["Enabled"] = false}
1296
	local deletenearbyplayershum = {["Enabled"] = false}
1297
	local deleteteammates = {["Enabled"] = false}
1298
	local certainblocks = {["ObjectList"] = {}}
1299
	deletenearby = GuiLibrary["ObjectsThatCanBeSaved"]["UtilityWindow"]["Api"].CreateOptionsButton({
1300
		["Name"] = "DeleteNearby",
1301
		["Function"] = function(callback)
1302
			if callback then 
1303
				local flag, flagobj = getPirateFlag()
1304
				if getItem("pirate_flag") or flag then 
1305
					if entity.isAlive then
1306
						if not flag then 
1307
							bedwars["placeBlock"](getScaffold(entity.character.HumanoidRootPart.Position - (entity.character.HumanoidRootPart.CFrame.lookVector * 4)), "pirate_flag")
1308
							flag, flagobj = getPirateFlag()
1309
						end
1310
						task.delay(0.3, function()
1311
							if flag then 
1312
								if deletenearbyblocks["Enabled"] then
1313
									for i,v in pairs(collectionservice:GetTagged("block")) do 
1314
										if v.Name ~= "pirate_flag" and (v.Position - flag).Magnitude <= 60 then 
1315
											if i % 100 == 0 then 
1316
												task.wait(0.3)
1317
											end
1318
											if #certainblocks["ObjectList"] <= 0 or table.find(certainblocks["ObjectList"], v.Name) then
1319
												delete(v, flag)
1320
											end
1321
										end
1322
									end
1323
								end
1324
								for i,v in pairs(entity.entityList) do 
1325
									if (v.RootPart.Position - flag).Magnitude <= 60 then 
1326
										if (not deleteteammates["Enabled"]) and (not v.Targetable) then continue end
1327
										if deletenearbyplayershum["Enabled"] then 
1328
											delete(v.RootPart, flag)
1329
										end
1330
										if deletenearbyplayers["Enabled"] then
1331
											delete(v.Head, flag)
1332
										end
1333
									end
1334
								end
1335
								if pickupitemdrop["Enabled"] then 
1336
									for i,v in pairs(collectionservice:GetTagged("ItemDrop")) do 
1337
										if (v.Position - flag).Magnitude <= 60 then 
1338
											delete(v, flag)
1339
										end
1340
									end
1341
								end
1342
								delete(flagobj, flag)
1343
							else 
1344
								createwarning("DeleteNearby", "skill", 10)
1345
							end
1346
						end)
1347
					end
1348
				else
1349
					createwarning("DeleteNearby", "no item u stupid", 10)
1350
				end
1351
				deletenearby["ToggleButton"](false)
1352
			end
1353
		end
1354
	})
1355
	pickupitemdrop = deletenearby.CreateToggle({
1356
		["Name"] = "ItemDrop",
1357
		["Function"] = function() end,
1358
		["Default"] = true
1359
	})
1360
	deletenearbyblocks = deletenearby.CreateToggle({
1361
		["Name"] = "Blocks",
1362
		["Function"] = function() end,
1363
		["Default"] = true
1364
	})
1365
	deletenearbyplayers = deletenearby.CreateToggle({
1366
		["Name"] = "Players",
1367
		["Function"] = function() end
1368
	})
1369
	deletenearbyplayershum = deletenearby.CreateToggle({
1370
		["Name"] = "Players Movement",
1371
		["Function"] = function() end
1372
	})
1373
	deleteteammates = deletenearby.CreateToggle({
1374
		["Name"] = "Teammates",
1375
		["Function"] = function() end,
1376
		["Default"] = true
1377
	})
1378
	certainblocks = deletenearby.CreateTextList({
1379
		["Name"] = "NukerList",
1380
		["TempText"] = "block (tesla_trap)",
1381
		["AddFunction"] = function() end
1382
	})
1383
end)
1384
1385
local bypassed = false
1386
runcode(function()
1387
	local anticheatdisabler = {["Enabled"] = false}
1388
	local anticheatdisablerauto = {["Enabled"] = false}
1389
	local anticheatdisablerconnection
1390
	local anticheatdisablerconnection2
1391
	anticheatdisabler = GuiLibrary["ObjectsThatCanBeSaved"]["UtilityWindow"]["Api"].CreateOptionsButton({
1392
		["Name"] = "FloatDisabler",
1393
		["Function"] = function(callback)
1394
			if callback then
1395
				local balloonitem = getItem("balloon")
1396
				if balloonitem then
1397
					local oldfunc3 = bedwars["BalloonController"].hookBalloon
1398
					local oldfunc4 = bedwars["BalloonController"].enableBalloonPhysics
1399
					local oldfunc5 = bedwars["BalloonController"].deflateBalloon
1400
					bedwars["BalloonController"].inflateBalloon()
1401
					bedwars["BalloonController"].enableBalloonPhysics = function() end
1402
					bedwars["BalloonController"].deflateBalloon = function() end
1403
					bedwars["BalloonController"].hookBalloon = function(Self, plr, attachment, balloon)
1404
						if tostring(plr) == lplr.Name then
1405
							balloon:WaitForChild("Balloon").CFrame = CFrame.new(0, -1995, 0)
1406
							balloon.Balloon:ClearAllChildren()
1407
							local threadidentity = syn and syn.set_thread_identity or setidentity
1408
							threadidentity(7)
1409
							spawn(function()
1410
								wait(0.5)
1411
								createwarning("AnticheatDisabler", "Disabled Anticheat!", 5)
1412
								bypassed = true
1413
							end)
1414
							threadidentity(2)
1415
							bedwars["BalloonController"].hookBalloon = oldfunc3
1416
							bedwars["BalloonController"].enableBalloonPhysics = oldfunc4
1417
						end
1418
					end
1419
				end
1420
				anticheatdisabler["ToggleButton"](true)
1421
			end
1422
		end
1423
	})
1424
	anticheatdisablerauto = anticheatdisabler.CreateToggle({
1425
		["Name"] = "Auto Disable",
1426
		["Function"] = function(callback)
1427
			if callback then
1428
				anticheatdisablerconnection = repstorage.Inventories.DescendantAdded:connect(function(p3)
1429
					if p3.Parent.Name == lplr.Name then
1430
						if p3.Name == "balloon" then
1431
							repeat task.wait() until getItem("balloon")
1432
							anticheatdisabler["ToggleButton"](false)
1433
						end
1434
					end
1435
				end)
1436
			else
1437
				if anticheatdisablerconnection then
1438
					anticheatdisablerconnection:Disconnect()
1439
				end
1440
			end
1441
		end,
1442
	})
1443
end)