Advertisement
AjareliVajkaci

dead rails aimlock mobile

Mar 13th, 2025
3,529
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.85 KB | None | 1 0
  1. --dead rails wall hack aimbot.
  2. local Players = game:GetService("Players")
  3. local player = Players.LocalPlayer
  4. player.CameraMode = Enum.CameraMode.Classic
  5. local runService = game:GetService("RunService")
  6. local StarterGui = game:GetService("StarterGui")
  7. local camera = workspace.CurrentCamera
  8.  
  9. StarterGui:SetCore("SendNotification", {
  10. Title = "Code by GioBolqvi", -- dont skid 🙏💔
  11. Text = "on Roblox",
  12. Duration = 3
  13. })
  14.  
  15. local screenGui = Instance.new("ScreenGui")
  16. screenGui.Name = "NPC_Lock_GUI"
  17. screenGui.Parent = game:GetService("CoreGui")
  18.  
  19. local button = Instance.new("TextButton")
  20. button.Name = "NPC Lock: ON/OFF"
  21. button.Size = UDim2.new(0, 150, 0, 50)
  22. button.Position = UDim2.new(0.5, -75, 0.9, -25)
  23. button.BackgroundColor3 = Color3.new(0, 0, 0)
  24. button.TextColor3 = Color3.new(1, 1, 1)
  25. button.Text = "NPC Lock: OFF"
  26. button.Font = Enum.Font.Fantasy
  27. button.TextScaled = true
  28. button.TextSize = 20
  29. button.Parent = screenGui
  30.  
  31. local uicorner = Instance.new("UICorner")
  32. uicorner.CornerRadius = UDim.new(0, 12)
  33. uicorner.Parent = button
  34.  
  35. local dragging = false
  36. local dragInput, dragStart, startPos
  37.  
  38. local function update(input)
  39. local delta = input.Position - dragStart
  40. button.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  41. end
  42.  
  43. button.InputBegan:Connect(function(input)
  44. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  45. dragging = true
  46. dragStart = input.Position
  47. startPos = button.Position
  48.  
  49. input.Changed:Connect(function()
  50. if input.UserInputState == Enum.UserInputState.End then
  51. dragging = false
  52. end
  53. end)
  54. end
  55. end)
  56.  
  57. button.InputChanged:Connect(function(input)
  58. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  59. dragInput = input
  60. end
  61. end)
  62.  
  63. game:GetService("UserInputService").InputChanged:Connect(function(input)
  64. if dragging and input == dragInput then
  65. update(input)
  66. end
  67. end)
  68.  
  69. local npcLock = false
  70. local lastTarget = nil
  71. local toggleLoop
  72.  
  73. local function addPlayerHighlight()
  74. if player.Character then
  75. local highlight = player.Character:FindFirstChild("PlayerHighlightESP")
  76. if not highlight then
  77. highlight = Instance.new("Highlight")
  78. highlight.Name = "PlayerHighlightESP"
  79. highlight.FillColor = Color3.new(1, 1, 1)
  80. highlight.OutlineColor = Color3.new(1, 1, 1)
  81. highlight.FillTransparency = 0.5
  82. highlight.OutlineTransparency = 0
  83. highlight.Parent = player.Character
  84. end
  85. end
  86. end
  87.  
  88. local function removePlayerHighlight()
  89. if player.Character and player.Character:FindFirstChild("PlayerHighlightESP") then
  90. player.Character.PlayerHighlightESP:Destroy()
  91. end
  92. end
  93.  
  94. local function getClosestNPC()
  95. local closestNPC = nil
  96. local closestDistance = math.huge
  97.  
  98. for _, object in ipairs(workspace:GetDescendants()) do
  99. if object:IsA("Model") then
  100. local humanoid = object:FindFirstChild("Humanoid") or object:FindFirstChildWhichIsA("Humanoid")
  101. local hrp = object:FindFirstChild("HumanoidRootPart") or object.PrimaryPart
  102. if humanoid and hrp and humanoid.Health > 0 and object.Name ~= "Horse" then
  103. local isPlayer = false
  104. for _, pl in ipairs(Players:GetPlayers()) do
  105. if pl.Character == object then
  106. isPlayer = true
  107. break
  108. end
  109. end
  110. if not isPlayer then
  111. local distance = (hrp.Position - player.Character.HumanoidRootPart.Position).Magnitude
  112. if distance < closestDistance then
  113. closestDistance = distance
  114. closestNPC = object
  115. end
  116. end
  117. end
  118. end
  119. end
  120.  
  121. return closestNPC
  122. end
  123.  
  124. button.MouseButton1Click:Connect(function()
  125. npcLock = not npcLock
  126. if npcLock then
  127. button.Text = "NPC Lock: ON"
  128. toggleLoop = runService.RenderStepped:Connect(function()
  129. local npc = getClosestNPC()
  130. if npc and npc:FindFirstChild("Humanoid") then
  131. local npcHumanoid = npc:FindFirstChild("Humanoid")
  132. if npcHumanoid.Health > 0 then
  133. camera.CameraSubject = npcHumanoid
  134. lastTarget = npc
  135. addPlayerHighlight()
  136. else
  137. StarterGui:SetCore("SendNotification", {
  138. Title = "Killed NPC",
  139. Text = npc.Name,
  140. Duration = 0.4
  141. })
  142. lastTarget = nil
  143. removePlayerHighlight()
  144. if player.Character and player.Character:FindFirstChild("Humanoid") then
  145. camera.CameraSubject = player.Character:FindFirstChild("Humanoid")
  146. end
  147. end
  148. else
  149. if player.Character and player.Character:FindFirstChild("Humanoid") then
  150. camera.CameraSubject = player.Character:FindFirstChild("Humanoid")
  151. end
  152. lastTarget = nil
  153. removePlayerHighlight()
  154. end
  155. end)
  156. else
  157. button.Text = "NPC Lock: OFF"
  158. if toggleLoop then
  159. toggleLoop:Disconnect()
  160. toggleLoop = nil
  161. end
  162. removePlayerHighlight()
  163. if player.Character and player.Character:FindFirstChild("Humanoid") then
  164. camera.CameraSubject = player.Character:FindFirstChild("Humanoid")
  165. end
  166. end
  167. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement