Advertisement
Guest User

Counter Blox Script

a guest
May 24th, 2019
15,767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.56 KB | None | 0 0
  1. loadstring(game:HttpGet("https://pastebin.com/raw/FdEw63PA", true))()
  2.  
  3. local plrs = game:GetService("Players")
  4. local TeamBased = true ; local teambasedswitch = "o"
  5. local presskeytoaim = true; local aimkey = "e"
  6. local raycast = false
  7.  
  8. local espupdatetime = 5; autoesp = false
  9.  
  10.  
  11.  
  12. local lockaim = true; local lockangle = 5
  13.  
  14.  
  15.  
  16. --function findwat(folder, what)
  17. -- for i, smth in pairs(folder:GetChildren()) do
  18. -- if string.find(string.lower(tostring(smth)), string.lower(what)) then
  19. -- return smth
  20. -- end
  21. -- end
  22. --end
  23. --
  24. --local plrs = findwat(game, "Players")
  25.  
  26.  
  27.  
  28.  
  29. local Gui = Instance.new("ScreenGui")
  30. local Move = Instance.new("Frame")
  31. local Main = Instance.new("Frame")
  32. local EspStatus = Instance.new("TextLabel")
  33. local st1 = Instance.new("TextLabel")
  34. local st1_2 = Instance.new("TextLabel")
  35. local st1_3 = Instance.new("TextLabel")
  36. local Name = Instance.new("TextLabel")
  37. --Properties:
  38. Gui.Name = "Gui"
  39. Gui.Parent = plrs.LocalPlayer:WaitForChild("PlayerGui")
  40.  
  41. Move.Name = "Move"
  42. Move.Parent = Gui
  43. Move.BackgroundColor3 = Color3.new(0.0431373, 1, 0.0745098)
  44. Move.BackgroundTransparency = 0.40000000596046
  45. Move.BorderSizePixel = 0
  46. Move.Position = UDim2.new(0.005, 0,0.018, 0)
  47. Move.Size = UDim2.new(0.28141585, 0, 0.0320388414, 0)
  48.  
  49. Main.Name = "Main"
  50. Main.Parent = Move
  51. Main.BackgroundColor3 = Color3.new(0.176471, 0.176471, 0.176471)
  52. Main.BackgroundTransparency = 0.69999998807907
  53. Main.Position = UDim2.new(0, 0, 0.995670795, 0)
  54. Main.Size = UDim2.new(1.0000006, 0, 9.79697132, 0)
  55.  
  56. EspStatus.Name = "EspStatus"
  57. EspStatus.Parent = Main
  58. EspStatus.BackgroundColor3 = Color3.new(1, 1, 1)
  59. EspStatus.BackgroundTransparency = 1
  60. EspStatus.Size = UDim2.new(0.272955924, 0, 0.161862016, 0)
  61. EspStatus.Font = Enum.Font.ArialBold
  62. EspStatus.Text = "Press T to update Esp"
  63. EspStatus.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  64. EspStatus.TextScaled = true
  65. EspStatus.TextSize = 14
  66. EspStatus.TextWrapped = true
  67.  
  68. st1.Name = "st1"
  69. st1.Parent = Main
  70. st1.BackgroundColor3 = Color3.new(1, 1, 1)
  71. st1.BackgroundTransparency = 1
  72. st1.Position = UDim2.new(0.271787882, 0, 0, 0)
  73. st1.Size = UDim2.new(0.728211343, 0, 0.161862016, 0)
  74. st1.Font = Enum.Font.ArialBold
  75. st1.Text = "Press "..aimkey.." to lock on a person inside ur view"
  76. st1.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  77. st1.TextScaled = true
  78. st1.TextSize = 14
  79. st1.TextWrapped = true
  80.  
  81. st1_2.Name = "st1"
  82. st1_2.Parent = Main
  83. st1_2.BackgroundColor3 = Color3.new(1, 1, 1)
  84. st1_2.BackgroundTransparency = 1
  85. st1_2.Position = UDim2.new(0, 0, 0.375590861, 0)
  86. st1_2.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  87. st1_2.Font = Enum.Font.ArialBold
  88. st1_2.Text = "Press L to enable esp loop"
  89. st1_2.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  90. st1_2.TextScaled = true
  91. st1_2.TextSize = 14
  92. st1_2.TextWrapped = true
  93.  
  94. st1_3.Name = "st1"
  95. st1_3.Parent = Main
  96. st1_3.BackgroundColor3 = Color3.new(1, 1, 1)
  97. st1_3.BackgroundTransparency = 1
  98. st1_3.Position = UDim2.new(0, 0, 0.18558608, 0)
  99. st1_3.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  100. st1_3.Font = Enum.Font.ArialBold
  101. st1_3.Text = "Press O to change team based mode"
  102. st1_3.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  103. st1_3.TextScaled = true
  104. st1_3.TextSize = 14
  105. st1_3.TextWrapped = true
  106. local teambasedstatus = st1_3:Clone()
  107. teambasedstatus.Parent = st1_3
  108. teambasedstatus.TextScaled = true
  109. teambasedstatus.Position = UDim2.new(0, 0,0.694, 0)
  110. teambasedstatus.Text = tostring(TeamBased)
  111.  
  112. Name.Name = "Name"
  113. Name.Parent = Move
  114. Name.BackgroundColor3 = Color3.new(1, 1, 1)
  115. Name.BackgroundTransparency = 1
  116. Name.Size = UDim2.new(0.838, 0, 0.980000019, 0)
  117. Name.Font = Enum.Font.Arial
  118. Name.Text = "FPS gui v1.0"
  119. Name.TextColor3 = Color3.new(0, 0, 0)
  120. Name.TextScaled = true
  121. Name.TextSize = 14
  122. Name.TextWrapped = true
  123. Name.TextXAlignment = Enum.TextXAlignment.Left
  124. -- Scripts:
  125.  
  126.  
  127. local plrsforaim = {}
  128.  
  129. local lplr = game:GetService("Players").LocalPlayer
  130. Move.Draggable = true
  131. Gui.ResetOnSpawn = false
  132. Gui.Name = "Chat"
  133. Gui.DisplayOrder = 999
  134.  
  135. Gui.Parent = plrs.LocalPlayer.PlayerGui
  136.  
  137.  
  138. f = {}
  139. local espforlder
  140.  
  141. f.addesp = function()
  142. --print("ESP ran")
  143. if espforlder then
  144. else
  145. espforlder = Instance.new("Folder")
  146. espforlder.Parent = game.Workspace.CurrentCamera
  147. end
  148. for i, v in pairs(espforlder:GetChildren()) do
  149. v:Destroy()
  150. end
  151. for _, plr in pairs(plrs:GetChildren()) do
  152. if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
  153. if TeamBased == true then
  154. if plr.Team.Name ~= plrs.LocalPlayer.Team.Name then
  155. local e = espforlder:FindFirstChild(plr.Name)
  156. if not e then
  157. --print("Added esp for team based")
  158. local bill = Instance.new("BillboardGui", espforlder)
  159. bill.Name = plr.Name
  160. bill.AlwaysOnTop = true
  161. bill.Size = UDim2.new(1,0,1,0)
  162. bill.Adornee = plr.Character.Head
  163. local Frame = Instance.new('Frame',bill)
  164. Frame.Active = true
  165. Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  166. Frame.BackgroundTransparency = 0
  167. Frame.BorderSizePixel = 0
  168. Frame.AnchorPoint = Vector2.new(.5, .5)
  169. Frame.Position = UDim2.new (0.5,0,0.5,0)
  170. Frame.Size = UDim2.new (1,0,1,0)
  171. Frame.Rotation = 0
  172. plr.Character.Humanoid.Died:Connect(function()
  173. bill:Destroy()
  174. end)
  175. end
  176. end
  177. else
  178. local e = espforlder:FindFirstChild(plr.Name)
  179. if not e then
  180. --print("Added esp")
  181. local bill = Instance.new("BillboardGui", espforlder)
  182. bill.Name = plr.Name
  183. bill.AlwaysOnTop = true
  184. bill.Size = UDim2.new(1,0,1,0)
  185. bill.Adornee = plr.Character.Head
  186. local Frame = Instance.new('Frame',bill)
  187. Frame.Active = true
  188. Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  189. Frame.BackgroundTransparency = 0
  190. Frame.BorderSizePixel = 0
  191. Frame.AnchorPoint = Vector2.new(.5, .5)
  192. Frame.Position = UDim2.new (0.5,0,0.5,0)
  193. Frame.Size = UDim2.new (1,0,1,0)
  194. Frame.Rotation = 0
  195. plr.Character.Humanoid.Died:Connect(function()
  196. bill:Destroy()
  197. end)
  198. end
  199. end
  200.  
  201.  
  202. end
  203. end
  204. end
  205. local cam = game.Workspace.CurrentCamera
  206.  
  207. local mouse = lplr:GetMouse()
  208. local switch = false
  209. local key = "k"
  210. local aimatpart = nil
  211. mouse.KeyDown:Connect(function(a)
  212. if a == "t" then
  213. print("worked1")
  214. f.addesp()
  215. elseif a == "u" then
  216. if raycast == true then
  217. raycast = false
  218. else
  219. raycast = true
  220. end
  221. elseif a == "l" then
  222. if autoesp == false then
  223. autoesp = true
  224. else
  225. autoesp = false
  226. end
  227. end
  228. if a == "j" then
  229. if mouse.Target then
  230. mouse.Target:Destroy()
  231. end
  232. end
  233. if a == key then
  234. if switch == false then
  235. switch = true
  236. else
  237. switch = false
  238. if aimatpart ~= nil then
  239. aimatpart = nil
  240. end
  241. end
  242. elseif a == teambasedswitch then
  243. if TeamBased == true then
  244. TeamBased = false
  245. teambasedstatus.Text = tostring(TeamBased)
  246. else
  247. TeamBased = true
  248. teambasedstatus.Text = tostring(TeamBased)
  249. end
  250. elseif a == aimkey then
  251. if not aimatpart then
  252. local maxangle = math.rad(20)
  253. for i, plr in pairs(plrs:GetChildren()) do
  254. if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  255. if TeamBased == true then
  256. if plr.Team.Name ~= lplr.Team.Name then
  257. local an = checkfov(plr.Character.Head)
  258. if an < maxangle then
  259. maxangle = an
  260. aimatpart = plr.Character.Head
  261. end
  262. end
  263. else
  264. local an = checkfov(plr.Character.Head)
  265. if an < maxangle then
  266. maxangle = an
  267. aimatpart = plr.Character.Head
  268. end
  269. print(plr)
  270. end
  271. plr.Character.Humanoid.Died:Connect(function()
  272. if aimatpart.Parent == plr.Character or aimatpart == nil then
  273. aimatpart = nil
  274. end
  275. end)
  276. end
  277. end
  278. else
  279. aimatpart = nil
  280. end
  281. end
  282. end)
  283.  
  284. function getfovxyz (p0, p1, deg)
  285. local x1, y1, z1 = p0:ToOrientation()
  286. local cf = CFrame.new(p0.p, p1.p)
  287. local x2, y2, z2 = cf:ToOrientation()
  288. --local d = math.deg
  289. if deg then
  290. --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  291. else
  292. return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  293. end
  294. end
  295.  
  296. function getaimbotplrs()
  297. plrsforaim = {}
  298. for i, plr in pairs(plrs:GetChildren()) do
  299. if plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name and plr.Character.Head then
  300.  
  301. if TeamBased == true then
  302. if plr.Team.Name ~= lplr.Team.Name then
  303. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  304. local r = Ray.new(cf, cf.LookVector * 10000)
  305. local ign = {}
  306. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  307. if v:IsA("BasePart") then
  308. table.insert(ign , v)
  309. end
  310. end
  311. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  312. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  313. table.insert(plrsforaim, obj)
  314. end
  315. end
  316. else
  317. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  318. local r = Ray.new(cf, cf.LookVector * 10000)
  319. local ign = {}
  320. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  321. if v:IsA("BasePart") then
  322. table.insert(ign , v)
  323. end
  324. end
  325. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  326. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  327. table.insert(plrsforaim, obj)
  328. end
  329. end
  330.  
  331.  
  332. end
  333. end
  334. end
  335.  
  336. function aimat(part)
  337. cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
  338. end
  339. function checkfov (part)
  340. local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
  341. local angle = math.abs(fov.X) + math.abs(fov.Y)
  342. return angle
  343. end
  344.  
  345. game:GetService("RunService").RenderStepped:Connect(function()
  346. if aimatpart then
  347. aimat(aimatpart)
  348. if aimatpart.Parent == plrs.LocalPlayer.Character then
  349. aimatpart = nil
  350. end
  351. end
  352.  
  353.  
  354. -- if switch == true then
  355. -- local maxangle = 99999
  356. --
  357. -- --print("Loop")
  358. -- if true and raycast == false then
  359. -- for i, plr in pairs(plrs:GetChildren()) do
  360. -- if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  361. -- if TeamBased then
  362. -- if plr.Team.Name ~= lplr.Team.Name or plr.Team.TeamColor ~= lplr.Team.TeamColor then
  363. -- local an = checkfov(plr.Character.Head)
  364. -- if an < maxangle then
  365. -- maxangle = an
  366. -- aimatpart = plr.Character.Head
  367. -- if an < lockangle then
  368. -- break
  369. -- end
  370. -- end
  371. -- end
  372. -- else
  373. -- local an = checkfov(plr.Character.Head)
  374. -- if an < maxangle then
  375. -- maxangle = an
  376. -- aimatpart = plr.Character.Head
  377. -- if an < lockangle then
  378. -- break
  379. -- end
  380. -- end
  381. -- end
  382. --
  383. --
  384. --
  385. --
  386. -- end
  387. -- end
  388. -- elseif raycast == true then
  389. --
  390. -- end
  391.  
  392. if raycast == true and switch == false and not aimatpart then
  393. getaimbotplrs()
  394. aimatpart = nil
  395. local maxangle = 999
  396. for i, v in ipairs(plrsforaim) do
  397. if v.Parent ~= lplr.Character then
  398. local an = checkfov(v)
  399. if an < maxangle and v ~= lplr.Character.Head then
  400. maxangle = an
  401. aimatpart = v
  402. print(v:GetFullName())
  403. v.Parent.Humanoid.Died:connect(function()
  404. aimatpart = nil
  405. end)
  406. end
  407. end
  408. end
  409.  
  410. end
  411. end)
  412. delay(0, function()
  413. while wait(espupdatetime) do
  414. if autoesp == true then
  415. pcall(function()
  416. f.addesp()
  417. end)
  418. end
  419. end
  420. end)
  421. warn("loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement