Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.41 KB | None | 0 0
  1. workspace.Characters.DescendantAdded:Connect(function(v)
  2. if v.Name == "Config" then
  3. if v.Parent.Parent.Parent.Parent.Name ~= game.Players.LocalPlayer.Name then return end
  4. local s = require(v).Stats
  5. s.Recoil = Vector3.new()
  6. s.CameraRecoil = 0
  7. end
  8. end)
  9.  
  10. function run()
  11.  
  12.  
  13.  
  14.  
  15.  
  16. -----------------------------------// aimbot script
  17.  
  18.  
  19. local cam = workspace.Camera
  20. local camera = workspace.Camera
  21. local plr = game:service'Players'.LocalPlayer
  22. local t
  23. local mouse = plr:GetMouse()
  24. local aimbot = true
  25. local whitelisted = {
  26. plr.Name;
  27. }
  28.  
  29. local ray = Ray.new
  30. local ray_start
  31.  
  32.  
  33.  
  34.  
  35. local checkifwhitelisted = function(nam)
  36. local asd = false
  37.  
  38. for _, a in pairs(whitelisted) do
  39. if nam == a then
  40. asd = true
  41. end
  42. end
  43.  
  44. return asd
  45. end
  46.  
  47. _G.gofor = "Head"
  48. local lPlayerTeam = nil
  49.  
  50. function checkteam(name)
  51. local teams = game.Teams
  52. local plr_team = nil
  53. for i,v in pairs(teams:GetDescendants()) do
  54. if plr_team == nil then
  55. if v.Name == name then
  56. plr_team = v.Parent
  57. return plr_team
  58. end
  59. end
  60. end
  61. end
  62. lPlayerTeam = checkteam(plr.Name)
  63.  
  64. function CheckIf(name)
  65. for i,v in pairs(workspace.Characters:children()) do
  66. if checkteam(name) ~= lPlayerTeam then
  67. return true
  68. end
  69. end
  70. return false
  71. end
  72.  
  73. local function getcloseplayer()
  74. --pcall(function()
  75. local ignorelist = workspace.Characters[plr.Name].Hitbox:children''
  76. for i,v in pairs(workspace:children'') do
  77. if v:IsA("Model") then
  78. table.insert(ignorelist,v)
  79. end
  80. end
  81. local closestDist = 2e9
  82. local player
  83.  
  84. for _, a in pairs(workspace.Characters:children()) do
  85. if a:IsA'Model' and game:service'Players':FindFirstChild(a.Name) and a.Name ~= plr.Name and checkifwhitelisted(a.Name) == false and CheckIf(a.Name) and a ~= nil then
  86.  
  87. local dist = (workspace.Characters[plr.Name].Root.Position - a.Root.Position).magnitude
  88.  
  89. if dist < closestDist then
  90. if a ~= nil and a:FindFirstChild'Hitbox' then
  91. if a.Hitbox:FindFirstChild'Head' then
  92. pcall(function()
  93. ray_start = workspace.Characters[plr.Name].Hitbox.Head.Position
  94. local vector = ( a.Hitbox.Head.Position - ray_start)
  95. local new_ray = ray(ray_start, vector.unit * 1000)
  96. local hit, position = workspace:FindPartOnRayWithIgnoreList(new_ray, ignorelist)
  97.  
  98. if (hit and hit:isDescendantOf(a.Hitbox)) then
  99. closestDist = dist
  100. player = a.Hitbox
  101. end
  102. end)
  103. end
  104. end
  105. end
  106.  
  107.  
  108. end
  109. end
  110.  
  111. return player
  112. --end)
  113. end
  114.  
  115. mouse.KeyDown:connect(function(key)
  116. if key == "[" then
  117. if aimbot then
  118. aimbot = false
  119. else
  120. aimbot = true
  121. end
  122. end
  123. end)
  124.  
  125. local closesthead = nil
  126.  
  127.  
  128. --------------------------------------------------------------------------////////////////////////// Cam Scripto
  129.  
  130. local UserInputService = game:GetService("UserInputService")
  131. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  132. local Workspace = game:GetService("Workspace")
  133. local Players = game:GetService("Players")
  134. local TS = require(ReplicatedStorage:WaitForChild("Tortoiseshell"))
  135. TS.Timer:UnbindFromRenderStep('Camera')
  136. local PLAYER = Players.LocalPlayer
  137. local CAMERA = Workspace.CurrentCamera
  138. local OFFSET = Vector3.new(0, 1.6, 0)
  139. local SPRINT_FOV_SCALE = 0.9
  140. local LEAN_DISTANCE = 2
  141. local LEAN_TILT = 0.15
  142. local MIN_Y, MAX_Y = -1.5, 1.5
  143. local SENSITIVITY = Vector2.new(0.004, 0.004)
  144. local recoilSpring = TS.Math.Spring:Create(1, 200, 30, 1)
  145. TS.Camera.FirstPerson.RecoilSpring = recoilSpring
  146. local character, root, state, sprinting, lean, vaulting, grounded, climbing, aiming, look, sliding, backpack, items, equipped, item, config
  147. local x, y = 0, 0
  148. local leanOffset = CFrame.new()
  149. local lastUpdate = 0
  150. local actionSpring = TS.Math.Spring:Create(1, 100, 10, 1)
  151. local slideFOV = 0
  152. local spectateChar
  153. local function Equipped(newItem)
  154. pcall(function()
  155. config = nil
  156. item = nil
  157. if newItem then
  158. config = TS.Items:GetConfig(newItem)
  159. item = newItem
  160. end
  161. end)
  162. end
  163. local function HandleCharacter(newCharacter)
  164. if newCharacter then
  165. character = nil
  166. spectateChar = nil
  167. root = newCharacter:WaitForChild("Root")
  168. state = newCharacter:WaitForChild("State")
  169. sprinting = state:WaitForChild("Sprinting")
  170. lean = state:WaitForChild("Lean")
  171. vaulting = state:WaitForChild("Vaulting")
  172. grounded = state:WaitForChild("Grounded")
  173. climbing = state:WaitForChild("Climbing")
  174. aiming = state:WaitForChild("Aiming")
  175. look = state:WaitForChild("Look")
  176. sliding = state:WaitForChild("Sliding")
  177. backpack = newCharacter:WaitForChild("Backpack")
  178. equipped = backpack:WaitForChild("Equipped")
  179. items = backpack:WaitForChild("Items")
  180. equipped.Changed:Connect(function()
  181. Equipped(equipped.Value)
  182. end)
  183. vaulting.Changed:Connect(function()
  184. if vaulting.Value then
  185. actionSpring:Shove(Vector3.new(sprinting.Value and -3 or -2, 0, 0))
  186. end
  187. end)
  188. climbing.Changed:Connect(function()
  189. if climbing.Value then
  190. actionSpring:Shove(Vector3.new(-10, 0, 0))
  191. end
  192. end)
  193. grounded.Changed:Connect(function()
  194. if not vaulting.Value and root.Velocity.Y < -60 then
  195. actionSpring:Shove(Vector3.new(root.Velocity.Y / 20, 0, 0))
  196. end
  197. end)
  198. newCharacter.DescendantAdded:Connect(function(obj)
  199. if obj:IsA("BasePart") then
  200. obj.LocalTransparencyModifier = 1
  201. end
  202. end)
  203. for _, v in pairs(newCharacter:GetDescendants()) do
  204. if v:IsA("BasePart") then
  205. v.LocalTransparencyModifier = 1
  206. end
  207. end
  208. Equipped(equipped.Value)
  209. character = newCharacter
  210. end
  211. end
  212. TS.Damage.CharacterKilled:Connect(function(char, _, player)
  213. if char == character and player then
  214. spectateChar = TS.Characters:GetCharacter(player)
  215. end
  216. end)
  217. TS.Characters.CharacterAdded:Connect(function(player, character)
  218. if player == PLAYER then
  219. HandleCharacter(character)
  220. end
  221. end)
  222. UserInputService.InputChanged:connect(function(inputObject, processed)
  223. if inputObject.UserInputType == Enum.UserInputType.MouseMovement then
  224. local fovSens = math.clamp((CAMERA.FieldOfView / TS.Camera.FieldOfView) ^ 1.5, 0, 1)
  225. x = (x - inputObject.Delta.X * SENSITIVITY.X * fovSens * TS.Camera.Sensitivity) % (math.pi * 2)
  226. y = math.clamp(y - inputObject.Delta.Y * SENSITIVITY.Y * fovSens * TS.Camera.Sensitivity, MIN_Y, MAX_Y)
  227. end
  228. end)
  229. CAMERA.FieldOfView = 1
  230. CAMERA.CameraType = Enum.CameraType.Scriptable
  231. HandleCharacter(TS.Characters:GetCharacter(PLAYER))
  232.  
  233.  
  234. TS.Timer:BindToRenderStep("Camera", 1, function(deltaTime)
  235. if workspace.Characters:FindFirstChild(plr.Name) == nil then
  236. TS.Timer:UnbindFromRenderStep('Camera')
  237. end
  238. if spectateChar then
  239. local center = spectateChar.PrimaryPart.Position + Vector3.new(0, 0.5, 0)
  240. CAMERA.FieldOfView = 50
  241. CAMERA.CFrame = CFrame.new(center) * CFrame.Angles(0, x, 0) * CFrame.Angles(y, 0, 0) * CFrame.new(0, 0, 15)
  242. CAMERA.Focus = CAMERA.CFrame * CFrame.new(0, 0, -20)
  243. elseif character and character.Parent then
  244. look.Value = y
  245. if sliding.Value then
  246. local speed = Vector2.new(root.Velocity.X, root.Velocity.Z).Magnitude
  247. slideFOV = TS.Math:Lerp(slideFOV, speed / 3 * (TS.Camera.FieldOfView / 90), math.min(deltaTime * 10, 1))
  248. else
  249. slideFOV = TS.Math:Lerp(slideFOV, 0, math.min(deltaTime * 10, 1))
  250. end
  251. local newFOV = TS.Camera.FieldOfView
  252. local center = root.CFrame:PointToWorldSpace(OFFSET)
  253. local player = getcloseplayer()
  254. if sprinting.Value then
  255. newFOV = newFOV * SPRINT_FOV_SCALE
  256. elseif aiming.Value then
  257. if aimbot then
  258. if player ~= nil then
  259. CAMERA.CoordinateFrame = CFrame.new(center, player.Head.Position)
  260. end
  261. end
  262. if item then
  263. newFOV = newFOV * config.Stats.AimFOV
  264. else
  265. newFOV = newFOV * 0.9
  266. end
  267. end
  268. CAMERA.FieldOfView = TS.Math:Lerp(CAMERA.FieldOfView, math.min(newFOV + slideFOV, 120), math.min(deltaTime * 10, 1))
  269. local leanAmount = lean.Value
  270. if math.abs(leanAmount) > 0.1 then
  271. local hit, position = TS.Raycast:CastGeometry(center + Vector3.new(0, -1, 0), root.CFrame:VectorToWorldSpace(Vector3.new(leanAmount * LEAN_DISTANCE * 2, 0, 0)))
  272. if hit then
  273. local distance = (position - center).Magnitude
  274. leanAmount = math.sin(lean.Value) * distance / (LEAN_DISTANCE * 2)
  275. end
  276. end
  277. local heightOffset = math.cos(leanAmount * math.pi / 2) - 1
  278. leanOffset = leanOffset:Lerp(CFrame.new(leanAmount * LEAN_DISTANCE, heightOffset * LEAN_DISTANCE / 4, 0) * CFrame.Angles(0, 0, -leanAmount * LEAN_TILT), math.min(deltaTime * 10, 1))
  279. actionSpring:Update(deltaTime)
  280. local actionOffset = CFrame.Angles(actionSpring.Position.X, actionSpring.Position.Y, actionSpring.Position.Z)
  281. local recoilOffset = CFrame.Angles(recoilSpring.Position.Y * 0, recoilSpring.Position.X * 0, 0)
  282. if aiming.Value == false or player == nil then
  283. CAMERA.CFrame = CFrame.new(center) * CFrame.Angles(0, x, 0) * CFrame.Angles(y, 0, 0) * leanOffset * actionOffset * recoilOffset
  284. end
  285. CAMERA.Focus = CAMERA.CFrame * CFrame.new(0, 0, -20)
  286. if 0.1 <= tick() - lastUpdate then
  287. lastUpdate = tick()
  288. TS.Network:Fire("Character", "State", "Look", y)
  289. end
  290. end
  291. end)
  292. end
  293.  
  294. run()
  295.  
  296. workspace.Characters.ChildAdded:Connect(function(v)
  297. if v.Name == game.Players.LocalPlayer.Name then
  298. wait(.2)
  299. run()
  300. end
  301. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement