-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathBaseCustomModule.vape
More file actions
108 lines (98 loc) · 5.25 KB
/
BaseCustomModule.vape
File metadata and controls
108 lines (98 loc) · 5.25 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
-- Credits to Inf Yield & all the other scripts that helped me make bypasses
local GuiLibrary = shared.GuiLibrary
local players = game:GetService("Players")
local lplr = players.LocalPlayer
local workspace = game:GetService("Workspace")
local lighting = game:GetService("Lighting")
local cam = workspace.CurrentCamera
local targetinfo = shared.VapeTargetInfo
local collectionservice = game:GetService("CollectionService")
local uis = game:GetService("UserInputService")
local mouse = lplr:GetMouse()
local robloxfriends = {}
local function friendCheck(plr)
if not robloxfriends[plr.UserId] then
if lplr:IsFriendsWith(plr.UserId) then
table.insert(robloxfriends, plr.Name)
robloxfriends[plr.UserId] = true
end
end
return (GuiLibrary["ObjectsThatCanBeSaved"]["Use FriendsToggle"]["Api"]["Enabled"] and ((GuiLibrary["ObjectsThatCanBeSaved"]["Use Roblox FriendsToggle"]["Api"]["Enabled"] and table.find(robloxfriends, plr.Name) == nil) and table.find(GuiLibrary["FriendsObject"]["Friends"], plr.Name) == nil) or GuiLibrary["ObjectsThatCanBeSaved"]["Use FriendsToggle"]["Api"]["Enabled"] == false)
end
shared.vapeteamcheck = function(plr)
return (GuiLibrary["ObjectsThatCanBeSaved"]["Teams by colorToggle"]["Api"]["Enabled"] and (bedwars["PlayerUtil"].getGamePlayer(lplr):getTeamId() ~= bedwars["PlayerUtil"].getGamePlayer(plr):getTeamId() or (lplr.Team == nil or #lplr.Team:GetPlayers() == #game:GetService("Players"):GetChildren())) or GuiLibrary["ObjectsThatCanBeSaved"]["Teams by colorToggle"]["Api"]["Enabled"] == false)
end
local function targetCheck(plr, check)
return (check and plr.Character.Humanoid.Health > 0 and plr.Character:FindFirstChild("ForceField") == nil or check == false)
end
local function isAlive(plr)
if plr then
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")
end
return lplr and lplr.Character and lplr.Character.Parent ~= nil and lplr.Character:FindFirstChild("HumanoidRootPart") and lplr.Character:FindFirstChild("Head") and lplr.Character:FindFirstChild("Humanoid")
end
local function isPlayerTargetable(plr, target, friend, team)
return plr ~= lplr and GuiLibrary["ObjectsThatCanBeSaved"]["PlayersToggle"]["Api"]["Enabled"] and plr and isAlive(plr) and targetCheck(plr, target) and (GuiLibrary["ObjectsThatCanBeSaved"]["Ignore nakedToggle"]["Api"]["Enabled"] and nakedcheck(plr) or GuiLibrary["ObjectsThatCanBeSaved"]["Ignore nakedToggle"]["Api"]["Enabled"] == false) and ((team and plr.Team == lplr.Team) or (team == nil and shared.vapeteamcheck(plr)))
end
local function vischeck(pos, pos2, ignore)
local vistab = cam:GetPartsObscuringTarget({pos, pos2}, ignore)
for i,v in pairs(vistab) do
print(i,v:GetFullName())
end
return not unpack(vistab)
end
local function GetAllNearestHumanoidToPosition(distance, amount)
local returnedplayer = {}
local currentamount = 0
if isAlive() then
for i, v in pairs(players:GetChildren()) do
if isPlayerTargetable(v, true, true) and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and currentamount < amount then
local mag = (lplr.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).magnitude
if mag <= distance then
table.insert(returnedplayer, v)
currentamount = currentamount + 1
end
end
end
end
return returnedplayer
end
local function GetNearestHumanoidToPosition(distance)
local closest, returnedplayer = distance, nil
if isAlive() then
for i, v in pairs(players:GetChildren()) do
if isPlayerTargetable(v, true, false) and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") then
local mag = (lplr.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).magnitude
if mag <= closest then
closest = mag
returnedplayer = v
end
end
end
end
return returnedplayer
end
local function GetNearestHumanoidToMouse(distance, checkvis)
local closest, returnedplayer = distance, nil
if isAlive() then
for i, v in pairs(players:GetChildren()) do
if isPlayerTargetable(v, true, true) and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and (checkvis == false or checkvis and (vischeck(v.Character, "Head") or vischeck(v.Character, "HumanoidRootPart"))) then
local vec, vis = cam:WorldToScreenPoint(v.Character.HumanoidRootPart.Position)
if vis then
local mag = (uis:GetMouseLocation() - Vector2.new(vec.X, vec.Y)).magnitude
if mag <= closest then
closest = mag
returnedplayer = v
end
end
end
end
end
return returnedplayer
end
GuiLibrary["RemoveObject"]("ReachOptionsButton")
GuiLibrary["ObjectsThatCanBeSaved"]["BlatantWindow"]["Api"].CreateOptionsButton("good", function()
print("enabled")
end, function()
print("disabled")
end, true, function() return " better" end, "This is a good button.")