Advertisement
benxogian

Untitled

Dec 30th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local camera = workspace.CurrentCamera
  3. local playerGui = player:WaitForChild("PlayerGui")
  4.  
  5. local smoothSpeed = 0.9
  6. local horizontalPrediction = 0.0346 -- Horizontal prediction value
  7. local verticalPrediction = 0.0538528682685329 -- Vertical prediction value
  8. local xOffset, yOffset, zOffset = 0.0346, 0.0346, 0.0346 -- All offsets set to 0.0346
  9. local isLockedOn = false
  10. local lockedPlayer = nil
  11.  
  12. local function enhancedPrediction(targetPlayer)
  13. if targetPlayer and targetPlayer.Character then
  14. local humanoidRootPart = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
  15. local head = targetPlayer.Character:FindFirstChild("Head")
  16. local velocity = humanoidRootPart.Velocity
  17.  
  18. local adjustedVelocity = Vector3.new(
  19. math.clamp(velocity.X, -50, 50),
  20. math.clamp(velocity.Y, -50, 50),
  21. math.clamp(velocity.Z, -50, 50)
  22. )
  23.  
  24. local predictedPosition = humanoidRootPart.Position + adjustedVelocity * verticalPrediction
  25. predictedPosition = Vector3.new(
  26. predictedPosition.X + xOffset,
  27. predictedPosition.Y + yOffset,
  28. predictedPosition.Z + zOffset
  29. )
  30.  
  31. if adjustedVelocity.Y > 2 then
  32. if head then
  33. predictedPosition = head.Position + Vector3.new(0, 0.5, 0)
  34. end
  35. elseif adjustedVelocity.Y < -2 then
  36. predictedPosition = humanoidRootPart.Position + Vector3.new(0, -0.5, 0)
  37. end
  38.  
  39. return predictedPosition
  40. end
  41. return nil
  42. end
  43.  
  44. local function lockOn()
  45. local closestPlayer = nil
  46. local shortestDistance = math.huge
  47. local screenCenter = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2)
  48.  
  49. for _, p in pairs(game.Players:GetPlayers()) do
  50. if p ~= player then
  51. local character = p.Character
  52. if character and character:FindFirstChild("HumanoidRootPart") then
  53. local head = character.HumanoidRootPart
  54. local headPos = camera:WorldToScreenPoint(head.Position)
  55.  
  56. local distance = (screenCenter - Vector2.new(headPos.X, headPos.Y)).Magnitude
  57. if distance < shortestDistance then
  58. shortestDistance = distance
  59. closestPlayer = p
  60. end
  61. end
  62. end
  63. end
  64.  
  65. if closestPlayer then
  66. lockedPlayer = closestPlayer
  67. isLockedOn = true
  68. else
  69. print("No player found to lock onto.")
  70. end
  71. end
  72.  
  73. local function smoothlyDragToPlayer(targetPlayer)
  74. if targetPlayer then
  75. local predictedPosition = enhancedPrediction(targetPlayer)
  76. if predictedPosition then
  77. local currentPosition = camera.CFrame.Position
  78. camera.CFrame = CFrame.new(currentPosition:Lerp(predictedPosition, smoothSpeed), predictedPosition)
  79. end
  80. end
  81. end
  82.  
  83. local function createLockButtonGUI()
  84. local screenGui = Instance.new("ScreenGui")
  85. screenGui.Parent = playerGui
  86.  
  87. local lockButton = Instance.new("TextButton")
  88. lockButton.Size = UDim2.new(0, 100, 0, 50)
  89. lockButton.Position = UDim2.new(1, -110, 0, 10)
  90. lockButton.Text = "Lock On"
  91. lockButton.Font = Enum.Font.GothamBold
  92. lockButton.TextColor3 = Color3.new(1, 1, 1)
  93. lockButton.BackgroundColor3 = Color3.fromRGB(50, 50, 200)
  94. lockButton.Parent = screenGui
  95.  
  96. local function makeRainbow(button)
  97. local colorIndex = 0
  98. task.spawn(function()
  99. while true do
  100. colorIndex = (colorIndex + 1) % 360
  101. button.BackgroundColor3 = Color3.fromHSV(colorIndex / 360, 1, 1)
  102. button.BorderSizePixel = 2
  103. button.BorderColor3 = Color3.new(1, 1, 1)
  104. task.wait(0.05)
  105. end
  106. end)
  107. end
  108. makeRainbow(lockButton)
  109.  
  110. lockButton.MouseButton1Click:Connect(function()
  111. if isLockedOn then
  112. lockedPlayer = nil
  113. isLockedOn = false
  114. lockButton.Text = "Lock On"
  115. else
  116. lockOn()
  117. lockButton.Text = "Locked"
  118. end
  119. end)
  120. end
  121.  
  122. createLockButtonGUI()
  123.  
  124. game:GetService("RunService").Heartbeat:Connect(function()
  125. if isLockedOn and lockedPlayer then
  126. smoothlyDragToPlayer(lockedPlayer)
  127. end
  128. end)
  129.  
  130. local player = game.Players.LocalPlayer
  131. local screenGui = Instance.new("ScreenGui")
  132. local textLabel = Instance.new("TextLabel")
  133. local copiedTextLabel = Instance.new("TextLabel")
  134.  
  135. screenGui.Parent = player:WaitForChild("PlayerGui")
  136. screenGui.ResetOnSpawn = false
  137.  
  138. local function playAudio()
  139. local sound = Instance.new("Sound")
  140. sound.SoundId = "rbxassetid://158012252"
  141. sound.Parent = game.Workspace
  142. sound:Play()
  143. end
  144.  
  145. local function displayTextAtTop()
  146. textLabel.Text = "Cware"
  147. textLabel.Position = UDim2.new(0.5, -75, 0, 10)
  148. textLabel.Size = UDim2.new(0, 150, 0, 50)
  149. textLabel.TextSize = 30
  150. textLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  151. textLabel.BackgroundTransparency = 1
  152. textLabel.TextTransparency = 0
  153. textLabel.TextStrokeTransparency = 0.8
  154. textLabel.TextStrokeColor3 = Color3.fromRGB(255, 255, 255)
  155. textLabel.Font = Enum.Font.GothamBold
  156. textLabel.Parent = screenGui
  157.  
  158. local function makeRainbowText()
  159. local colors = {Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 165, 0), Color3.fromRGB(255, 255, 0), Color3.fromRGB(0, 255, 0), Color3.fromRGB(0, 0, 255), Color3.fromRGB(75, 0, 130), Color3.fromRGB(238, 130, 238)}
  160. local index = 1
  161. while true do
  162. textLabel.TextColor3 = colors[index]
  163. index = index + 1
  164. if index > #colors then
  165. index = 1
  166. end
  167. wait(0.1)
  168. end
  169. end
  170.  
  171. coroutine.wrap(makeRainbowText)()
  172. end
  173.  
  174. local function displayCopiedText()
  175. copiedTextLabel.Text = "COPIED DISCORD LINK JOIN FOR UPDATES!"
  176. copiedTextLabel.Position = UDim2.new(0.5, -150, 0, -40)
  177. copiedTextLabel.Size = UDim2.new(0, 300, 0, 30)
  178. copiedTextLabel.TextSize = 14
  179. copiedTextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  180. copiedTextLabel.BackgroundTransparency = 1
  181. copiedTextLabel.TextTransparency = 0
  182. copiedTextLabel.TextStrokeTransparency = 0.8
  183. copiedTextLabel.TextStrokeColor3 = Color3.fromRGB(255, 255, 255)
  184. copiedTextLabel.Font = Enum.Font.GothamBold
  185. copiedTextLabel.Parent = screenGui
  186.  
  187. wait(4)
  188. copiedTextLabel:TweenTransparency(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 1, true)
  189. end
  190.  
  191. local function copyDiscordLink()
  192. setclipboard("https://discord.gg/HwTmqpfwft")
  193. end
  194.  
  195. playAudio()
  196. copyDiscordLink()
  197. displayTextAtTop()
  198. displayCopiedText()
  199.  
  200. player.CharacterAdded:Connect(function()
  201. createLockButtonGUI()
  202. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement