kyanopro

Untitled

Feb 29th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local aimenabled = Instance.new("TextButton")
  9. local fov = Instance.new("TextBox")
  10. local smoothness = Instance.new("TextBox")
  11.  
  12. --Properties:
  13.  
  14. ScreenGui.Parent = game.CoreGui
  15.  
  16. Frame.Parent = ScreenGui
  17. Frame.BackgroundColor3 = Color3.fromRGB(36, 36, 36)
  18. Frame.BorderSizePixel = 0
  19. Frame.Position = UDim2.new(0.14317508, 0, 0.222961724, 0)
  20. Frame.Size = UDim2.new(0, 163, 0, 79)
  21.  
  22. aimenabled.Name = "aimenabled"
  23. aimenabled.Parent = Frame
  24. aimenabled.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  25. aimenabled.BorderSizePixel = 0
  26. aimenabled.Position = UDim2.new(0.0764094591, 0, 0.144265369, 0)
  27. aimenabled.Size = UDim2.new(0, 30, 0, 52)
  28. aimenabled.Font = Enum.Font.SourceSans
  29. aimenabled.Text = ""
  30. aimenabled.TextColor3 = Color3.fromRGB(0, 0, 0)
  31. aimenabled.TextSize = 14.000
  32.  
  33. fov.Name = "fov"
  34. fov.Parent = Frame
  35. fov.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  36. fov.Position = UDim2.new(0.339562356, 0, 0.144265383, 0)
  37. fov.Size = UDim2.new(0, 100, 0, 21)
  38. fov.Font = Enum.Font.SourceSans
  39. fov.PlaceholderText = "fov"
  40. fov.Text = ""
  41. fov.TextColor3 = Color3.fromRGB(0, 0, 0)
  42. fov.TextSize = 14.000
  43.  
  44. smoothness.Name = "smoothness"
  45. smoothness.Parent = Frame
  46. smoothness.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  47. smoothness.Position = UDim2.new(0.339562356, 0, 0.527029574, 0)
  48. smoothness.Size = UDim2.new(0, 100, 0, 21)
  49. smoothness.Font = Enum.Font.SourceSans
  50. smoothness.PlaceholderText = "smoothness"
  51. smoothness.Text = ""
  52. smoothness.TextColor3 = Color3.fromRGB(0, 0, 0)
  53. smoothness.TextSize = 14.000
  54.  
  55. -- Scripts:
  56.  
  57. local function QCFP_fake_script() -- aimenabled.LocalScript
  58. local script = Instance.new('LocalScript', aimenabled)
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. local TOGGLED = false -- ;)
  66. local plrs=game:GetService("Players")
  67. local plr=plrs.LocalPlayer
  68. local mouse=plr:GetMouse()
  69. local smallest=math.huge
  70. local camera=workspace.CurrentCamera
  71. local fov=tonumber(script.Parent.Parent.fov.Text)
  72. local smooth=tonumber(script.Parent.Parent.smoothness.Text)
  73. local inptSrvc=game:GetService("UserInputService")
  74. local ok
  75.  
  76. script.Parent.MouseButton1Click:Connect(function()
  77. TOGGLED = not TOGGLED
  78. if TOGGLED == false then
  79. script.Parent.BackgroundColor3 = Color3.fromRGB(93, 93, 93)
  80. else
  81. script.Parent.BackgroundColor3 = Color3.fromRGB(0, 234, 129)
  82. end
  83. end)
  84.  
  85.  
  86. local function getnearest()
  87. smallest=math.huge
  88. for _,v in pairs(plrs:GetChildren()) do
  89. if v~=plr then
  90. if v:FindFirstChild("Status") then
  91. if v.Status.Team.Value~=plr.Status.Team.Value then
  92. if workspace:FindFirstChild(v.Name) then
  93. if v.Character:FindFirstChild("Humanoid") then
  94. if v.Character.Humanoid.Health > 0 then
  95. local worldPoint = v.Character.Head.Position
  96. local vector, onScreen = camera:WorldToScreenPoint(worldPoint)
  97. local magnitude = (Vector2.new(mouse.X, mouse.Y) - Vector2.new(vector.X, vector.Y)).magnitude
  98. if smallest>magnitude then
  99. smallest=magnitude
  100. ok=v
  101. end
  102. end
  103. end
  104. end
  105. end
  106. end
  107. end
  108. end
  109. end
  110.  
  111. game['Run Service'].RenderStepped:connect(function()
  112. if script.Parent.BackgroundColor3 == Color3.fromRGB(0, 234, 129) then
  113. getnearest()
  114. fov=tonumber(script.Parent.Parent.fov.Text)
  115. smooth=tonumber(script.Parent.Parent.smoothness.Text)
  116. if inptSrvc:IsMouseButtonPressed(0) then
  117. if workspace:FindFirstChild(ok.Name) then
  118. if ok.Character:FindFirstChild("Humanoid") then
  119. if ok.Character:FindFirstChild("Head") then
  120. if ok.Character.Humanoid.Health>0.1 then
  121. local worldPoint = ok.Character.Head.Position
  122. local vector, onScreen = camera:WorldToScreenPoint(worldPoint)
  123. local magnitude = (Vector2.new(mouse.X, mouse.Y) - Vector2.new(vector.X, vector.Y)).magnitude
  124. if magnitude<fov then
  125. local magnitudeX = mouse.X - vector.X
  126. local magnitudeY = mouse.Y - vector.Y
  127. local xsmooth=magnitudeX/smooth
  128. local ysmooth=magnitudeY/smooth
  129. mousemoverel(-xsmooth,-ysmooth)
  130. end
  131. end
  132. end
  133. end
  134. end
  135. end
  136. end
  137. end)
  138. end
  139. coroutine.wrap(QCFP_fake_script)()
Add Comment
Please, Sign In to add comment