forked from 7GrandDadPGN/VapeV4ForRoblox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseCustomModule.lua
181 lines (162 loc) · 7.67 KB
/
BaseCustomModule.lua
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
-- Credits to Inf Yield & all the other scripts that helped me make bypasses
local GuiLibrary = shared.GuiLibrary
local players = game:GetService("Players")
local textservice = game:GetService("TextService")
local lplr = players.LocalPlayer
local workspace = game:GetService("Workspace")
local lighting = game:GetService("Lighting")
local cam = workspace.CurrentCamera
local targetinfo = shared.VapeTargetInfo
local uis = game:GetService("UserInputService")
local localmouse = lplr:GetMouse()
local requestfunc = syn and syn.request or http and http.request or http_request or fluxus and fluxus.request or getgenv().request or request
local getasset = getsynasset or getcustomasset
local RenderStepTable = {}
local StepTable = {}
local function BindToRenderStep(name, num, func)
if RenderStepTable[name] == nil then
RenderStepTable[name] = game:GetService("RunService").RenderStepped:connect(func)
end
end
local function UnbindFromRenderStep(name)
if RenderStepTable[name] then
RenderStepTable[name]:Disconnect()
RenderStepTable[name] = nil
end
end
local function BindToStepped(name, num, func)
if StepTable[name] == nil then
StepTable[name] = game:GetService("RunService").Stepped:connect(func)
end
end
local function UnbindFromStepped(name)
if StepTable[name] then
StepTable[name]:Disconnect()
StepTable[name] = nil
end
end
local function createwarning(title, text, delay)
pcall(function()
local frame = GuiLibrary["CreateNotification"](title, text, delay, "assets/WarningNotification.png")
frame.Frame.BackgroundColor3 = Color3.fromRGB(236, 129, 44)
frame.Frame.Frame.BackgroundColor3 = Color3.fromRGB(236, 129, 44)
end)
end
local function friendCheck(plr, recolor)
return (recolor and GuiLibrary["ObjectsThatCanBeSaved"]["Recolor visualsToggle"]["Api"]["Enabled"] or (not recolor)) and GuiLibrary["ObjectsThatCanBeSaved"]["Use FriendsToggle"]["Api"]["Enabled"] and table.find(GuiLibrary["ObjectsThatCanBeSaved"]["FriendsListTextCircleList"]["Api"]["ObjectList"], plr.Name) and GuiLibrary["ObjectsThatCanBeSaved"]["FriendsListTextCircleList"]["Api"]["ObjectListEnabled"][table.find(GuiLibrary["ObjectsThatCanBeSaved"]["FriendsListTextCircleList"]["Api"]["ObjectList"], plr.Name)]
end
local function getPlayerColor(plr)
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)
end
local function getcustomassetfunc(path)
if not isfile(path) then
spawn(function()
local textlabel = Instance.new("TextLabel")
textlabel.Size = UDim2.new(1, 0, 0, 36)
textlabel.Text = "Downloading "..path
textlabel.BackgroundTransparency = 1
textlabel.TextStrokeTransparency = 0
textlabel.TextSize = 30
textlabel.Font = Enum.Font.SourceSans
textlabel.TextColor3 = Color3.new(1, 1, 1)
textlabel.Position = UDim2.new(0, 0, 0, -36)
textlabel.Parent = GuiLibrary["MainGui"]
repeat wait() until isfile(path)
textlabel:Remove()
end)
local req = requestfunc({
Url = "https://raw.githubusercontent.com/7GrandDadPGN/VapeV4ForRoblox/main/"..path:gsub("vape/assets", "assets"),
Method = "GET"
})
writefile(path, req.Body)
end
return getasset(path)
end
shared.vapeteamcheck = function(plr)
return (GuiLibrary["ObjectsThatCanBeSaved"]["Teams by colorToggle"]["Api"]["Enabled"] and (plr.Team ~= lplr.Team 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)
return plr ~= lplr and plr and (friend and friendCheck(plr) == nil or (not friend)) and isAlive(plr) and targetCheck(plr, target) and shared.vapeteamcheck(plr)
end
local function vischeck(char, part)
return not unpack(cam:GetPartsObscuringTarget({lplr.Character[part].Position, char[part].Position}, {lplr.Character, char}))
end
local function runcode(func)
func()
end
local function GetAllNearestHumanoidToPosition(player, distance, amount)
local returnedplayer = {}
local currentamount = 0
if isAlive() then
for i, v in pairs(players:GetChildren()) do
if isPlayerTargetable((player and v or nil), 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(player, distance)
local closest, returnedplayer = distance, nil
if isAlive() then
for i, v in pairs(players:GetChildren()) do
if isPlayerTargetable((player and v or nil), true, true) 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(player, distance, checkvis)
local closest, returnedplayer = distance, nil
if isAlive() then
for i, v in pairs(players:GetChildren()) do
if isPlayerTargetable((player and v or nil), 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
local function CalculateObjectPosition(pos)
local newpos = cam:WorldToViewportPoint(cam.CFrame:pointToWorldSpace(cam.CFrame:pointToObjectSpace(pos)))
return Vector2.new(newpos.X, newpos.Y)
end
local function CalculateLine(startVector, endVector, obj)
local Distance = (startVector - endVector).Magnitude
obj.Size = UDim2.new(0, Distance, 0, 2)
obj.Position = UDim2.new(0, (startVector.X + endVector.X) / 2, 0, ((startVector.Y + endVector.Y) / 2) - 36)
obj.Rotation = math.atan2(endVector.Y - startVector.Y, endVector.X - startVector.X) * (180 / math.pi)
end
local function findTouchInterest(tool)
for i,v in pairs(tool:GetDescendants()) do
if v:IsA("TouchTransmitter") then
return v
end
end
return nil
end