benxogian

Untitled

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