Advertisement
Guest User

Da hood best camlock

a guest
Oct 8th, 2024
1,425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.93 KB | None | 0 0
  1. getgenv().NemesisPreBeta = {
  2. ["Settings"] = {
  3. Disabling = {Toggle = false, Keybind = "H"},
  4. UpdateTickDelay = 0.05
  5. },
  6. ["Camlock"] = {
  7. Toggling = {
  8. Enable = true,
  9. Keybind = "q"
  10. },
  11. Settings = {
  12. Prediction = {
  13. true,
  14. 0.125544,
  15. false,
  16. .003
  17. },
  18. Smoothing = {
  19. smoothness = true,
  20. x = 1,
  21. y = 1
  22. },
  23. OffSets = {
  24. Jump = {
  25. Enable = false,
  26. [1] = Vector3.new(0, 3, 0)
  27. }
  28. }
  29. },
  30. Conditions = {
  31. Player = {
  32. WallCheck = false,
  33. Grabbed = false,
  34. Knocked = true,
  35. CrewID = false
  36. },
  37. BodyParts = {"HumanoidRootPart", "Head"}
  38. }
  39. },
  40. ["Silent"] = {
  41. Toggling = { Enable = false },
  42. Settings = {
  43. Prediction = { true , 0.11934 , false, 0.003 },
  44. HitChance = 100,
  45. Resolver = true,
  46. OffSets = {
  47. Jump = {
  48. Enable = false,
  49. [1] = Vector3.new(0, 0, 0)
  50. }
  51. }
  52. },
  53. Conditions = {
  54. Player = { WallCheck = false, Grabbed = false, Knocked = false, CrewID = false },
  55. BodyParts = {"HumanoidRootPart", "UpperTorso", "Head"}
  56. }
  57. },
  58. ["Field Of View"] = {
  59. Enable = true,
  60. Size = 1000,
  61. Color = Color3.fromRGB(255, 255, 255),
  62. },
  63. ["Miscs"] = {
  64. ["Sorting"] = {
  65. Toggled = false,
  66. Key = "F",
  67. alphabetically = true,
  68. Ammo = false,
  69. Custom = {
  70. Enable = false,
  71. List = {[1] = "[Revolver]", [2] = "[Chicken]"} -- // etc
  72. }
  73. },
  74. ["Animation"] = {
  75. Enable = true,
  76. Animations = {["Greet"] = {[1] = false, [2] = "V"}}
  77. }
  78. }
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85. local DUpvalue, Round, V3, V2, CF, Rservice, UserInput, Ping, Mouse, backpack = debug.getupvalue, math.round, Vector3.new, Vector2.new, CFrame.new, game:GetService("RunService"), game:GetService("UserInputService"), game:GetService("Stats").PerformanceStats.Ping, game:GetService("Players").LocalPlayer:GetMouse(), game:GetService("Players").LocalPlayer.Backpack
  86. local Players, Self, Character, Camera = game:GetService("Players"), game:GetService("Players").LocalPlayer, game:GetService("Players").LocalPlayer.Character or game:GetService("Players").LocalPlayer.CharacterAdded:Wait(), game:GetService("Workspace").CurrentCamera
  87. local idx, endp
  88.  
  89.  
  90. local Storage = {
  91. Drawings = {},
  92. Connections = {},
  93. targets = {
  94. [1] = nil,
  95. [2] = nil
  96. },
  97. ValuePosition = nil,
  98. bodyparts = {
  99. [1] = "",
  100. [2] = ""
  101. },
  102. update_tick = tick(),
  103. etc = {
  104. Ctoggled = false,
  105. Mtoggled = false
  106. },
  107. items = {}
  108. }
  109.  
  110.  
  111.  
  112. function NewConnection(type, callback)
  113. local connection = type:Connect(callback)
  114. Storage.Connections[#Storage.Connections+1] = connection
  115. return connection
  116. end
  117.  
  118. function Chance(chance, maxchance)
  119. return math.random(maxchance) <= chance
  120. end
  121.  
  122.  
  123. function Thread(Function, ...)
  124. local co
  125. local success, result
  126.  
  127. if Function ~= nil then
  128. co = coroutine.create(Function)
  129. success, result = coroutine.resume(co, ...)
  130. end
  131. if success ~= nil and co ~= nil and Function ~= nil then
  132. return result
  133. end
  134. end
  135.  
  136.  
  137. function wallcheck(origin)
  138. local parts = Camera:GetPartsObscuringTarget({origin.Position, Character.HumanoidRootPart.Position}, {Camera, Character, origin.Parent})
  139. if #parts == 0 then
  140. return true
  141. end
  142. return false
  143. end
  144.  
  145. function Grabbed(player)
  146. if player.Character ~= nil then
  147. return not player.Character:FindFirstChild("GRABBING_CONSTRAINT")
  148. end
  149. end
  150.  
  151. function Knocked(player)
  152. if player.Character ~= nil then
  153. return player.Character.BodyEffects["K.O"].Value ~= true
  154. end
  155. end
  156.  
  157.  
  158. local pingHistory = {}
  159. local lastPingUpdateTime = tick()
  160.  
  161.  
  162.  
  163. function GetPrediction()
  164. local currentPing = Ping:GetValue() * 0.003
  165. if getgenv().NemesisPreBeta.Camlock.Settings.Prediction[3] or getgenv().NemesisPreBeta.Silent.Settings.Prediction[3] then
  166. return currentPing
  167. else
  168. return getgenv().NemesisPreBeta.Camlock.Settings.Prediction[2] and getgenv().NemesisPreBeta.Silent.Settings.Prediction[2]
  169. end
  170. end
  171.  
  172. function Crew(player)
  173. if game.Players.LocalPlayer:FindFirstChild("DataFolder"):FindFirstChild("Information"):FindFirstChild("Crew") then
  174. local SelfCrewValue = game.Players.LocalPlayer:FindFirstChild("DataFolder"):FindFirstChild("Information"):FindFirstChild("Crew")
  175. if SelfCrewValue.Value ~= 0 then
  176. if player:FindFirstChild("DataFolder"):FindFirstChild("Information"):FindFirstChild("Crew") then
  177. local Enimy = player:FindFirstChild("DataFolder"):FindFirstChild("Information"):FindFirstChild("Crew")
  178. if Enimy.Value == SelfCrewValue.Value then
  179. return false
  180. end
  181. end
  182. end
  183. end
  184. return true
  185. end
  186.  
  187.  
  188.  
  189. function Closespart(player, hitboxes)
  190. local closestPart
  191. local closestDistanc = math.huge
  192. for _, hitbox in pairs(hitboxes) do
  193. local part = player.Character:FindFirstChild(hitbox)
  194. if part then
  195. local pos = Camera:WorldToViewportPoint(part.Position)
  196. local distance = (UserInput:GetMouseLocation() - V2(pos.X, pos.Y)).Magnitude
  197. if distance < closestDistanc then
  198. closestPart = part
  199. closestDistanc = distance
  200. end
  201. end
  202. end
  203. return closestPart
  204. end
  205.  
  206.  
  207.  
  208. function isInCustomList(toolName)
  209. for _, customName in ipairs(getgenv().NemesisPreBeta.Miscs.Sorting.Custom.List) do
  210. if toolName == customName then
  211. return true
  212. end
  213. end
  214. return false
  215. end
  216.  
  217.  
  218. function GetClosest(table)
  219. local MaxDistance = getgenv().NemesisPreBeta["Field Of View"].Enable and getgenv().NemesisPreBeta["Field Of View"].Size or math.huge
  220. local Target
  221.  
  222. for i,v in pairs(Players:GetPlayers()) do
  223. if v ~= Self and v.Character ~= nil and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") then
  224. local ViewPort, Visible = Camera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  225. local Mag = (UserInput:GetMouseLocation() - Vector2.new(ViewPort.X, ViewPort.Y)).Magnitude
  226. if MaxDistance > Mag and Visible and (
  227. (table.WallCheck and wallcheck(v.Character.HumanoidRootPart)) or true and
  228. (table.Grabbed and Grabbed(v)) or true and
  229. (table.Knocked and Knocked(v)) or true and
  230. (table.CrewID and Crew(v)) or true
  231. ) then
  232. MaxDistance = Mag
  233. Target = v
  234. end
  235. end
  236. end
  237. return Target
  238. end
  239.  
  240. function Velocity(Target, method)
  241. if method == true then
  242. local pos = Target.Character.HumanoidRootPart.Position
  243. local lastTime = tick()
  244. local currentPos, currentTime
  245. local connection
  246. connection =
  247. game:GetService("RunService").Heartbeat:Connect(
  248. function()
  249. currentPos = Target.Character.HumanoidRootPart.Position
  250. currentTime = tick()
  251. connection:Disconnect()
  252. end
  253. )
  254. wait(0.01)
  255. local velocity = (currentPos - pos) / (currentTime - lastTime)
  256. return Vector3.new(math.floor(velocity.X), math.floor(velocity.Y), math.floor(velocity.Z))
  257. else
  258. return Target.character:FindFirstChild("HumanoidRootPart").AssemblyLinearVelocity
  259. end
  260. end
  261.  
  262. function playAnimation(animationName)
  263. local args = {
  264. [1] = "AnimationPack",
  265. [2] = animationName,
  266. }
  267. game:GetService("ReplicatedStorage").MainEvent:FireServer(unpack(args))
  268. end
  269.  
  270.  
  271. -- // updates
  272.  
  273. function UpdateSilent()
  274. local SilentTable = getgenv().NemesisPreBeta.Silent
  275. if SilentTable.Toggling.Enable then
  276. Storage.targets[2] = GetClosest(SilentTable.Conditions.Player)
  277. if Storage.targets[2] ~= nil and Storage.targets[2].Character ~= nil and Storage.targets[2].Character:FindFirstChild("HumanoidRootPart") then
  278. Storage.bodyparts[2] = tostring(Closespart(Storage.targets[2], SilentTable.Conditions.BodyParts))
  279. local position = Storage.targets[2].Character[Storage.bodyparts[2]].Position
  280. if SilentTable.Settings.OffSets.Jump.Enable and Storage.targets[2].Character:FindFirstChildOfClass("Humanoid"):GetState() == Enum.HumanoidStateType.Freefall then
  281. position = position + SilentTable.Settings.OffSets.Jump[1]
  282. end
  283. Storage.CFposition = position + (SilentTable.Settings.Prediction and Velocity(Storage.targets[2], SilentTable.Settings.Resolver) * GetPrediction() or 0)
  284. end
  285. end
  286. end
  287.  
  288.  
  289. function UpdateCamlock()
  290. local CamLockTable = getgenv().NemesisPreBeta.Camlock
  291. if Storage.etc.Ctoggled and CamLockTable.Toggling.Enable and Storage.targets[1] ~= nil and Storage.targets[1].Character ~= nil then
  292. local position = Storage.targets[1].Character[Storage.bodyparts[1]].Position
  293.  
  294. if CamLockTable.Settings.OffSets.Jump.Enable and Storage.targets[1].Character:FindFirstChildOfClass("Humanoid"):GetState() == Enum.HumanoidStateType.Freefall then
  295. position = position + CamLockTable.Settings.OffSets.Jump[1]
  296. end
  297.  
  298. if CamLockTable.Settings.Smoothing.enable then
  299. local goal = CFrame.new(Camera.CFrame.Position, position + (CamLockTable.Settings.Prediction[1] * GetPrediction() or Vector3.new()))
  300. Camera.CFrame = Camera.CFrame:Lerp(goal, CamLockTable.Settings.Smoothing.x, CamLockTable.Settings.Smoothing.y)
  301. else
  302. local prediction = CamLockTable.Settings.Prediction[1] and Storage.targets[1].Character.HumanoidRootPart.AssemblyLinearVelocity * GetPrediction() or Vector3.new()
  303. Camera.CFrame = CFrame.new(Camera.CFrame.Position, position + prediction)
  304. end
  305. end
  306. end
  307.  
  308. do -- main connection
  309.  
  310. NewConnection(UserInput.InputBegan, function(key, wtv)
  311. if key.KeyCode == Enum.KeyCode[getgenv().NemesisPreBeta.Camlock.Toggling.Keybind:upper()] and not wtv then
  312. if getgenv().NemesisPreBeta.Camlock.Toggling.Enable then
  313. Storage.etc.Ctoggled = not Storage.etc.Ctoggled
  314. Storage.targets[1] = GetClosest(getgenv().NemesisPreBeta.Camlock.Conditions.Player)
  315.  
  316. if Storage.targets[1] and Storage.targets[1].Character then
  317. Storage.bodyparts[1] = tostring(Closespart(Storage.targets[1], getgenv().NemesisPreBeta.Camlock.Conditions.BodyParts))
  318.  
  319. end
  320. else
  321. if Storage.targets[1] ~= nil then
  322. Storage.targets[1] = nil
  323. end
  324. end
  325. end
  326. end)
  327.  
  328. NewConnection(UserInput.InputBegan, function(key, wtv)
  329. if getgenv().NemesisPreBeta.Settings.Disabling.Toggle and key.KeyCode == Enum.KeyCode[getgenv().NemesisPreBeta.Settings.Disabling.Keybind:upper()] and not wtv then
  330. for i,v in pairs(Storage.Connections) do
  331. if v then
  332. v:Disconnect()
  333. end
  334. end
  335. for i,v in pairs(Storage.Drawings) do
  336. if v and v.__OBJECT_EXISTS then
  337. print("f")
  338. end
  339. end
  340. end
  341. end)
  342.  
  343. NewConnection(UserInput.InputBegan, function(key, wtv)
  344. if getgenv().NemesisPreBeta.Miscs.Sorting.Toggled and key.KeyCode == Enum.KeyCode[getgenv().NemesisPreBeta.Miscs.Sorting.Key:upper()] and not wtv then
  345. local items = {}
  346.  
  347. if getgenv().NemesisPreBeta.Miscs.Sorting.Custom.Enable then
  348. for _, customName in ipairs(getgenv().NemesisPreBeta.Miscs.Sorting.Custom.List) do
  349. for _, item in pairs(backpack:GetChildren()) do
  350. if item:IsA("Tool") and item.Name == customName then
  351. table.insert(items, 1, item)
  352. break
  353. end
  354. end
  355. end
  356. end
  357.  
  358. for _, item in pairs(backpack:GetChildren()) do
  359. if item:IsA("Tool") and (not getgenv().NemesisPreBeta.Miscs.Sorting.Custom.Enable or not isInCustomList(item.Name)) then
  360. table.insert(items, item)
  361. end
  362. end
  363.  
  364. if getgenv().NemesisPreBeta.Miscs.Sorting.alphabetically and not getgenv().NemesisPreBeta.Miscs.Sorting.Custom.Enable then
  365. table.sort(items, function(a, b)
  366. return a.Name < b.Name
  367. end)
  368. end
  369.  
  370. if getgenv().NemesisPreBeta.Miscs.Sorting.Ammo and not getgenv().NemesisPreBeta.Miscs.Sorting.Custom.Enable then
  371. table.sort(items, function(a, b)
  372. return a.Value > b.Value
  373. end)
  374. end
  375.  
  376. for _, item in ipairs(items) do
  377. item.Parent = nil
  378. wait(0.01)
  379. item.Parent = backpack
  380. end
  381.  
  382. end
  383. end)
  384.  
  385. NewConnection(UserInput.InputBegan, function(key, wtv)
  386. if getgenv().NemesisPreBeta.Miscs.Animation.Enable and not wtv then
  387. for animationName, animationData in pairs(getgenv().NemesisPreBeta.Miscs.Animation.Animations) do
  388. if animationData[1] and key.KeyCode == Enum.KeyCode[animationData[2]] then
  389. playAnimation(animationName)
  390. break
  391. end
  392. end
  393. end
  394. end)
  395.  
  396.  
  397.  
  398.  
  399. NewConnection(Rservice.Heartbeat, function()
  400.  
  401. --// camlock
  402. Thread(UpdateCamlock())
  403.  
  404. --// Silent UPDATE
  405. Thread(UpdateSilent())
  406.  
  407. end)
  408. end
  409.  
  410.  
  411. for connection, index in next, getconnections(workspace.CurrentCamera.Changed) do
  412. index:Disable()
  413. end
  414. for connection, index in next, getconnections(workspace.CurrentCamera:GetPropertyChangedSignal("CFrame")) do
  415. index:Disable()
  416. end
  417.  
  418.  
  419. local oldIndex
  420. oldIndex = hookmetamethod(game, "__index", function(t, k)
  421. if t:IsA("Mouse") and k == "Hit" or k == "Target" then
  422. if getgenv().NemesisPreBeta.Silent.Toggling.Enable and Chance(getgenv().NemesisPreBeta.Silent.Settings.HitChance, 100) and Storage.targets[2] ~= nil then
  423. local Hit = CFrame.new(Storage.CFposition)
  424. return (k == "Hit" and Hit)
  425. end
  426. end
  427. return oldIndex(t, k)
  428. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement