Advertisement
refuzion

OPAIM

Apr 11th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.03 KB | None | 0 0
  1. ----This only works when in first person mode (zoomed in all the way)----
  2. print("[AIMBOT] by REFUZION loading")
  3. print("[AIMBOT] Change settings on lines 4 and 5 of the script")
  4. print("[AIMBOT] Do not release this script without proper credits")
  5. local Headshot_Key = Enum.KeyCode.C
  6. local Torsoshot_Key = Enum.KeyCode.V
  7.  
  8. local plr = game.Players.LocalPlayer
  9. local Gui = Instance.new("ScreenGui",game.CoreGui)
  10. Gui.Name = "AimbotGui"
  11. local version = "1.0.1"
  12.  
  13. HDown = false
  14. TDown = false
  15. mouse = game.Players.LocalPlayer:GetMouse()
  16. cam = game.Workspace.CurrentCamera
  17. Players = game:service("Players")
  18.  
  19. function onKeyPress(inputObject, gameProcessedEvent)
  20. if inputObject.KeyCode == Headshot_Key then
  21. if HDown == false and TDown == false then
  22. HDown = true
  23. print("[AIMBOT] Calculating closest player head")
  24. local targetpoint = mouse.Hit
  25. local p = game.Players:GetChildren()
  26. local lowestdist = 99999999999
  27. local lowestplayer = nil
  28. for i=1,#p do
  29. if p[i]~=game.Players.LocalPlayer and p[i].Character~=nil and p[i].Character~=nil and p[i].TeamColor~=game.Players.LocalPlayer.TeamColor and p[i].Character.Humanoid.Health >0 and p[i].TeamColor~=BrickColor.new("White") then
  30. local dist = p[i]:DistanceFromCharacter(Vector3.new(targetpoint.X,targetpoint.Y,targetpoint.Z))
  31. if dist < lowestdist then
  32. lowestdist = dist
  33. lowestplayer = p[i]
  34. end
  35. end
  36. end
  37. if lowestplayer~=nil then
  38. print("[AIMBOT] Targeting "..lowestplayer.Name)
  39. while HDown do
  40. wait()
  41. local TPos = lowestplayer.Character.Head.Position
  42. cam.CFrame = CFrame.new(Vector3.new(cam.CFrame.X,cam.CFrame.Y,cam.CFrame.Z),Vector3.new(TPos.X,TPos.Y,TPos.Z))
  43. end
  44. end
  45. end
  46. elseif inputObject.KeyCode == Torsoshot_Key then
  47. if TDown == false and HDown == false then
  48. TDown = true
  49. print("[AIMBOT] Calculating closest player body")
  50. local targetpoint = mouse.Hit
  51. local p = game.Players:GetChildren()
  52. local lowestdist = 99999999999
  53. local lowestplayer = nil
  54. for i=1,#p do
  55. if p[i]~=game.Players.LocalPlayer and p[i].Character~=nil and p[i].Character~=nil and p[i].TeamColor~=game.Players.LocalPlayer.TeamColor and p[i].Character.Humanoid.Health >0 and p[i].TeamColor~=BrickColor.new("White") then
  56. local dist = p[i]:DistanceFromCharacter(Vector3.new(targetpoint.X,targetpoint.Y,targetpoint.Z))
  57. if dist < lowestdist then
  58. lowestdist = dist
  59. lowestplayer = p[i]
  60. end
  61. end
  62. end
  63. if lowestplayer~=nil then
  64. print("[AIMBOT] Targeting "..lowestplayer.Name)
  65. while TDown do
  66. wait()
  67. local TPos = lowestplayer.Character.Torso.Position
  68. cam.CFrame = CFrame.new(Vector3.new(cam.CFrame.X,cam.CFrame.Y,cam.CFrame.Z),Vector3.new(TPos.X,TPos.Y,TPos.Z))
  69. end
  70. end
  71. end
  72. end
  73. end
  74.  
  75. function onKeyRelease(inputObject, gameProcessedEvent)
  76. if inputObject.KeyCode == Headshot_Key then
  77. HDown = false
  78. elseif inputObject.KeyCode == Torsoshot_Key then
  79. TDown = false
  80. end
  81. end
  82.  
  83. function Esp(player, username)
  84. if player ~= Players.LocalPlayer and player.Character then
  85. local torso = player.Character:FindFirstChild("Torso")
  86. if torso then
  87. local base = Instance.new("BillboardGui", workspace.CurrentCamera)
  88. local esP = Instance.new("Frame", base)
  89. base.AlwaysOnTop = true
  90. base.Enabled = true
  91. base.Size = UDim2.new(3.5,0,4.7,0)
  92. base.Name = username
  93. base.Adornee = torso
  94. base.StudsOffset = Vector3.new(0, -0.6, 0)
  95. esP.BackgroundColor3 = Color3.new(1,0,0)
  96. esP.BackgroundTransparency = 0.8
  97. esP.BorderColor3 = Color3.new(0,0,0)
  98. esP.BorderSizePixel = 1
  99. esP.Size = UDim2.new(1,0,1,0)
  100. end
  101. end
  102. end
  103.  
  104. function CheckEsp()
  105. for x,player in pairs(Players:GetChildren()) do
  106. if player then
  107. if player.TeamColor ~= plr.TeamColor then
  108. local char = player.Character
  109. if char then
  110. local torso = char:FindFirstChild("Torso")
  111. if torso then
  112. local currentcam = workspace.CurrentCamera
  113. local playerName = player.Name
  114. if currentcam:FindFirstChild(playerName) == nil then
  115. Esp(player, playerName)
  116. end
  117. end
  118. end
  119. end
  120. end
  121. end
  122. end
  123.  
  124. local function createframe(bkgc3,bkgtrans,borderc3, bordersize, name, parent, pos, rot, size, visible, zindex)
  125. local newframe = Instance.new("Frame")
  126. newframe.BackgroundColor3 = bkgc3
  127. newframe.BackgroundTransparency = bkgtrans
  128. newframe.BorderColor3 = borderc3
  129. newframe.BorderSizePixel = bordersize
  130. newframe.Name = name
  131. newframe.Parent = parent
  132. newframe.Position = pos
  133. newframe.Rotation = rot
  134. newframe.Size = size
  135. newframe.Visible = visible
  136. newframe.ZIndex = zindex
  137. return newframe
  138. end
  139.  
  140. local function createlabel(bkgc3,bkgtrans,borderc3, bordersize, name, parent, pos, rot, size, visible, zindex, font, fontsize, text, textc3, textscaled, textstrokec3, textstroketrans, texttrans, textwrapped, xalign, yalign)
  141. local newlabel = Instance.new("TextLabel")
  142. newlabel.BackgroundColor3 = bkgc3
  143. newlabel.BackgroundTransparency = bkgtrans
  144. newlabel.BorderColor3 = borderc3
  145. newlabel.BorderSizePixel = bordersize
  146. newlabel.Name = name
  147. newlabel.Parent = parent
  148. newlabel.Position = pos
  149. newlabel.Rotation = rot
  150. newlabel.Size = size
  151. newlabel.Visible = visible
  152. newlabel.ZIndex = zindex
  153. newlabel.Font = font
  154. newlabel.FontSize = fontsize
  155. newlabel.Text = text
  156. newlabel.TextColor3 = textc3
  157. newlabel.TextScaled = textscaled
  158. newlabel.TextStrokeColor3 = textstrokec3
  159. newlabel.TextStrokeTransparency = textstroketrans
  160. newlabel.TextTransparency = texttrans
  161. newlabel.TextWrapped = textwrapped
  162. newlabel.TextXAlignment = xalign
  163. newlabel.TextYAlignment = yalign
  164. return newlabel
  165. end
  166.  
  167. local function createbutton(autocolor, bkgc3,bkgtrans,borderc3, bordersize, name, parent, pos, rot, size, visible, zindex, font, fontsize, text, textc3, textscaled, textstrokec3, textstroketrans, texttrans, textwrapped, xalign, yalign)
  168. local newbutton = Instance.new("TextButton")
  169. newbutton.AutoButtonColor = autocolor
  170. newbutton.BackgroundColor3 = bkgc3
  171. newbutton.BackgroundTransparency = bkgtrans
  172. newbutton.BorderColor3 = borderc3
  173. newbutton.BorderSizePixel = bordersize
  174. newbutton.Name = name
  175. newbutton.Parent = parent
  176. newbutton.Position = pos
  177. newbutton.Rotation = rot
  178. newbutton.Size = size
  179. newbutton.Visible = visible
  180. newbutton.ZIndex = zindex
  181. newbutton.Font = font
  182. newbutton.FontSize = fontsize
  183. newbutton.Text = text
  184. newbutton.TextColor3 = textc3
  185. newbutton.TextScaled = textscaled
  186. newbutton.TextStrokeColor3 = textstrokec3
  187. newbutton.TextStrokeTransparency = textstroketrans
  188. newbutton.TextTransparency = texttrans
  189. newbutton.TextWrapped = textwrapped
  190. newbutton.TextXAlignment = xalign
  191. newbutton.TextYAlignment = yalign
  192. return newbutton
  193. end
  194.  
  195. local function createtextbox(bkgc3,bkgtrans,borderc3, bordersize, clrtext, multiline, name, parent, pos, rot, size, visible, zindex, font, fontsize, text, textc3, textscaled, textstrokec3, textstroketrans, texttrans, textwrapped, xalign, yalign)
  196. local newbox = Instance.new("TextBox")
  197. newbox.BackgroundColor3 = bkgc3
  198. newbox.BackgroundTransparency = bkgtrans
  199. newbox.BorderColor3 = borderc3
  200. newbox.BorderSizePixel = bordersize
  201. newbox.ClearTextOnFocus = clrtext
  202. newbox.MultiLine = multiline
  203. newbox.Name = name
  204. newbox.Parent = parent
  205. newbox.Position = pos
  206. newbox.Rotation = rot
  207. newbox.Size = size
  208. newbox.Visible = visible
  209. newbox.ZIndex = zindex
  210. newbox.Font = font
  211. newbox.FontSize = fontsize
  212. newbox.Text = text
  213. newbox.TextColor3 = textc3
  214. newbox.TextScaled = textscaled
  215. newbox.TextStrokeColor3 = textstrokec3
  216. newbox.TextStrokeTransparency = textstroketrans
  217. newbox.TextTransparency = texttrans
  218. newbox.TextWrapped = textwrapped
  219. newbox.TextXAlignment = xalign
  220. newbox.TextYAlignment = yalign
  221. return newbox
  222. end
  223.  
  224. local function createimagelabel(bkgc3,bkgtrans,borderc3, bordersize, name, parent, pos, rot, size, visible, zindex, image, imagetrans)
  225. local newimage = Instance.new("ImageLabel")
  226. newimage.BackgroundColor3 = bkgc3
  227. newimage.BackgroundTransparency = bkgtrans
  228. newimage.BorderColor3 = borderc3
  229. newimage.BorderSizePixel = bordersize
  230. newimage.Name = name
  231. newimage.Parent = parent
  232. newimage.Position = pos
  233. newimage.Rotation = rot
  234. newimage.Size = size
  235. newimage.Visible = visible
  236. newimage.ZIndex = zindex
  237. newimage.Image = "rbxassetid://"..image
  238. newimage.ImageTransparency = imagetrans
  239. return newimage
  240. end
  241.  
  242. -------------------------------INITIALIZE INTRO GUI-------------------------------------
  243. local IntroFrame = createframe(Color3.new(155/255,0/255,0/255),0,Color3.new(27/255,42/255,53/255),0,"IntroFrame",Gui,UDim2.new(0,-330,0,0),0,UDim2.new(0,300,1,0),true,1)
  244. --[[bar]] createframe(Color3.new(55/255,0/255,0/255),0,Color3.new(0,0,0),0,"bar",IntroFrame,UDim2.new(1,0,0,0),0,UDim2.new(0,30,0,90),true,1)
  245. --[[slant]] createimagelabel(Color3.new(55/255,0/255,0/255),1,Color3.new(0,0,0),0,"Slant",IntroFrame,UDim2.new(1,0,0,90),90,UDim2.new(0,30,0,30),true,1,474172996,0)
  246. --[[creator]] createlabel(Color3.new(1,1,1),1,Color3.new(0,0,0),0,"Creator",IntroFrame,UDim2.new(0,80,1,-40),0,UDim2.new(0,140,0,30),true,1,Enum.Font.Code,Enum.FontSize.Size28,"REFUZION",Color3.new(27/255,42/255,53/255), false,Color3.new(0,0,0),1,0,true,Enum.TextXAlignment.Center,Enum.TextYAlignment.Center)
  247. --[[creatorlabel]] createlabel(Color3.new(55/255,0/255,0/255),1,Color3.new(0,0,0),0,"CreatorLabel",IntroFrame,UDim2.new(0,80,1,-70),0,UDim2.new(0,140,0,30),true,1,Enum.Font.Code,Enum.FontSize.Size18,"Made by:",Color3.new(27/255,42/255,53/255), false,Color3.new(0,0,0),1,0,true,Enum.TextXAlignment.Center,Enum.TextYAlignment.Center)
  248. --[[desc]] createlabel(Color3.new(55/255,0/255,0/255),1,Color3.new(0,0,0),0,"Desc",IntroFrame,UDim2.new(0,0,0,120),0,UDim2.new(1,0,0,90),true,1,Enum.Font.SourceSansLight,Enum.FontSize.Size14,"Hold 'C' for headlock or hold 'E' for bodylock",Color3.new(0,0,0), true,Color3.new(0,0,0),1,0,true,Enum.TextXAlignment.Center,Enum.TextYAlignment.Center)
  249. --[[subtitle]] createlabel(Color3.new(1,1,1),1,Color3.new(0,0,0),0,"SubTitle",IntroFrame,UDim2.new(0.5,-150,0,70),0,UDim2.new(0,300,0,40),true,1,Enum.Font.SourceSansBold,Enum.FontSize.Size32,"Aimbot",Color3.new(27/255,42/255,53/255), false,Color3.new(0,0,0),1,0,true,Enum.TextXAlignment.Center,Enum.TextYAlignment.Center)
  250. --[[title]] createlabel(Color3.new(1,1,1),1,Color3.new(0,0,0),0,"Title",IntroFrame,UDim2.new(0.5,-105,0,20),0,UDim2.new(0,210,0,60),true,1,Enum.Font.SourceSansBold,Enum.FontSize.Size60,"OPAIM",Color3.new(27/255,42/255,53/255), false,Color3.new(0,0,0),1,0,true,Enum.TextXAlignment.Center,Enum.TextYAlignment.Center)
  251.  
  252. IntroFrame:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
  253. wait(3.5)
  254. IntroFrame:TweenPosition(UDim2.new(0,-330,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Quart,0.5,true)
  255. wait(0.5)
  256. Gui:Destroy()
  257.  
  258. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
  259. game:GetService("UserInputService").InputEnded:connect(onKeyRelease)
  260.  
  261. while wait(1) do
  262. CheckEsp()
  263. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement