Advertisement
iMeanOk

Untitled

Nov 6th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.66 KB | None | 0 0
  1.  
  2. --These can be edited--
  3. local toggable = {
  4. target = "Head",
  5. walls = false,
  6. chams = true,
  7. ffa = false,
  8. auto = false,
  9. triggerbot = false,
  10. enabled = true
  11. }
  12. --These can be edited--
  13.  
  14. --Hotkeys--
  15. local keys = {
  16. target = Enum.KeyCode.F,
  17. walls = Enum.KeyCode.P,
  18. chams = Enum.KeyCode.H,
  19. ffa = Enum.KeyCode.K,
  20. auto = Enum.KeyCode.L,
  21. tiggerbot = Enum.KeyCode.V,
  22. enabled = Enum.KeyCode.Q
  23. }
  24. --Hotkeys--
  25.  
  26. --These can not--
  27. local players = game:GetService("Players")
  28. local workspace = game:GetService("Workspace")
  29. local lp = players.LocalPlayer
  30. repeat wait(0.025) until lp.Character
  31. local lpc = lp.Character
  32. local camera = workspace.CurrentCamera
  33. local mouse = lp:GetMouse()
  34. local mdown = false
  35. local chams = Instance.new("Folder")
  36. chams.Name = "ScapChams"
  37. chams.Parent = game.CoreGui
  38. --These can not--
  39.  
  40. --Functions--
  41. function checkWalls(pos)
  42. if pos.Parent:FindFirstChild("HumanoidRootPart") and pos and lpc:FindFirstChild(toggable.target) then
  43. local hit = workspace:FindPartOnRayWithIgnoreList(Ray.new(lpc.HumanoidRootPart.CFrame.p, (pos.Parent.HumanoidRootPart.CFrame.p-lpc.HumanoidRootPart.CFrame.p).unit*500), {camera, lpc, chams}, false, true)
  44.  
  45. if hit.Name == pos.Name or hit.Name == "Head" or hit.Name == "HumanoidRootPart" or hit.Name == "Torso" or hit.Name == "UpperTorso" or hit.Name == "LowerTorso" or hit:IsDescendantOf(pos.Parent) then
  46. return true
  47. end
  48.  
  49. return false
  50. end
  51. end
  52.  
  53. function getReturn(v)
  54. if v ~= "none" then
  55.  
  56. if v.Character:FindFirstChild(toggable.target) then
  57.  
  58. if toggable.walls and v.Character:FindFirstChild(toggable.target) and lpc:FindFirstChild("HumanoidRootPart") then
  59. return v.Character[toggable.target].CFrame.p
  60. elseif checkWalls(v.Character[toggable.target]) and v.Character:FindFirstChild(toggable.target) and lpc:FindFirstChild("HumanoidRootPart") then
  61. return v.Character[toggable.target].CFrame.p
  62. end
  63. end
  64.  
  65. end
  66. end
  67.  
  68. function grabClosest()
  69. local mini = 21e8
  70. local closest = "none"
  71.  
  72. for _,v in pairs(players:GetChildren()) do
  73. if v.Name ~= lp.Name and lpc:FindFirstChild("HumanoidRootPart") and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  74.  
  75. if not toggable.walls and toggable.ffa and (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini then
  76.  
  77. if checkWalls(v.Character[toggable.target]) then
  78. mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
  79. closest = v
  80. end
  81. elseif not toggable.walls and (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini and v.TeamColor ~= lp.TeamColor then
  82.  
  83. if checkWalls(v.Character[toggable.target]) then
  84. mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
  85. closest = v
  86. end
  87. elseif toggable.ffa and (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini then
  88.  
  89. mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
  90. closest = v
  91. elseif (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini and v.TeamColor ~= lp.TeamColor then
  92.  
  93. mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
  94. closest = v
  95. end
  96. end
  97. end
  98.  
  99. return getReturn(closest)
  100. end
  101.  
  102. function grabColor(pos, plr)
  103. if toggable.ffa then
  104. return Color3.fromRGB(255, 0, 0)
  105. elseif plr.TeamColor == lp.TeamColor then
  106. return Color3.fromRGB(0, 255, 0)
  107. elseif plr.TeamColor ~= lp.TeamColor then
  108. return Color3.fromRGB(255, 0, 0)
  109. end
  110. end
  111.  
  112. function createChams()
  113. chams:ClearAllChildren()
  114.  
  115. for _,v in pairs(players:GetChildren()) do
  116. if v.Name ~= lp.Name then
  117.  
  118. if v.Character then
  119. for _,c in pairs(v.Character:GetChildren()) do
  120. if c:IsA("BasePart") then
  121. local cham = Instance.new("BoxHandleAdornment")
  122. cham.Name = "Cham"
  123. cham.Color3 = grabColor(c, v)
  124. cham.Adornee = c
  125. cham.Size = c.Size+Vector3.new(0.01, 0.01, 0.01)
  126. cham.AlwaysOnTop = true
  127. cham.ZIndex = 1
  128. cham.Parent = chamsz
  129. end
  130. end
  131. end
  132.  
  133. end
  134. end
  135. end
  136. --Functions--
  137.  
  138. --Main Framework--
  139. game:GetService("RunService").RenderStepped:connect(function()
  140. if toggable.enabled and mdown or toggable.enabled and toggable.auto then
  141. local closest = grabClosest()
  142.  
  143. if closest then
  144. game:GetService("TweenService"):Create(camera, TweenInfo.new(0.065, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {CFrame = CFrame.new(camera.Focus.p, closest)*CFrame.new(0, 0, 0.5)}):Play()
  145. if not toggable.walls and toggable.triggerbot then
  146. mouse1press()
  147. wait()
  148. mouse1release()
  149. end
  150. end
  151. end
  152. end)
  153.  
  154. game:GetService("UserInputService").InputBegan:connect(function(key)
  155. for i,v in pairs(keys) do
  156. if key.KeyCode == v then
  157.  
  158. if type(toggable[i]) == "boolean" then
  159. toggable[i] = not toggable[i]
  160.  
  161. if i == "chams" then
  162. if toggable[i] then
  163. createChams()
  164. else
  165. chams:ClearAllChildren()
  166. end
  167. end
  168. else
  169. if toggable[i] == "Head" then
  170. toggable[i] = "HumanoidRootPart"
  171. else
  172. toggable[i] = "Head"
  173. end
  174. end
  175.  
  176. end
  177. end
  178. end)
  179.  
  180. mouse.Button2Down:connect(function()
  181. mdown = true
  182. end)
  183.  
  184. mouse.Button2Up:connect(function()
  185. mdown = false
  186. end)
  187.  
  188. if toggable.chams then
  189. createChams()
  190. end
  191.  
  192. players.LocalPlayer.CharacterAdded:connect(function(char)
  193. wait(0.25)
  194.  
  195. lpc = char
  196.  
  197. if toggable.chams then
  198. createChams()
  199. end
  200. end)
  201. --Main Framework--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement