Advertisement
Guest User

dead rails script

a guest
Feb 17th, 2025
5,054
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 1
  1. -- some other shit for that game
  2.  
  3. loadstring(game:HttpGet("https://gist.githubusercontent.com/Diamond2Top/208d3e9dc59d1263eb52b0ba6bf3f7c8/raw/2b144300a1f48995ac688e2bebcbc80d7f3e1e33/gistfile1.txt"))()
  4.  
  5. -- for dead rails by kamerzystanasyt (aimbot)
  6. local fov = 136
  7. local RunService = game:GetService("RunService")
  8. local UserInputService = game:GetService("UserInputService")
  9. local Cam = workspace.CurrentCamera
  10. local Player = game:GetService("Players").LocalPlayer
  11.  
  12. local FOVring = Drawing.new("Circle")
  13. FOVring.Visible = false
  14. FOVring.Thickness = 2
  15. FOVring.Color = Color3.fromRGB(128, 0, 128)
  16. FOVring.Filled = false
  17. FOVring.Radius = fov
  18. FOVring.Position = Cam.ViewportSize / 2
  19.  
  20. local isAiming = false
  21. local validNPCs = {}
  22. local raycastParams = RaycastParams.new()
  23. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  24.  
  25. local ScreenGui = Instance.new("ScreenGui")
  26. ScreenGui.Parent = game.CoreGui
  27.  
  28. local ToggleButton = Instance.new("TextButton")
  29. ToggleButton.Size = UDim2.new(0, 120, 0, 40)
  30. ToggleButton.Position = UDim2.new(0, 10, 0, 10)
  31. ToggleButton.Text = "AIMBOT: OFF"
  32. ToggleButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  33. ToggleButton.TextColor3 = Color3.fromRGB(255, 50, 50)
  34. ToggleButton.Font = Enum.Font.GothamBold
  35. ToggleButton.TextSize = 14
  36. ToggleButton.Parent = ScreenGui
  37.  
  38. local function isNPC(obj)
  39. return obj:IsA("Model")
  40. and obj:FindFirstChild("Humanoid")
  41. and obj.Humanoid.Health > 0
  42. and obj:FindFirstChild("Head")
  43. and obj:FindFirstChild("HumanoidRootPart")
  44. and not game:GetService("Players"):GetPlayerFromCharacter(obj)
  45. end
  46.  
  47. local function updateNPCs()
  48. local tempTable = {}
  49. for _, obj in ipairs(workspace:GetDescendants()) do
  50. if isNPC(obj) then
  51. tempTable[obj] = true
  52. end
  53. end
  54. for i = #validNPCs, 1, -1 do
  55. if not tempTable[validNPCs[i]] then
  56. table.remove(validNPCs, i)
  57. end
  58. end
  59. for obj in pairs(tempTable) do
  60. if not table.find(validNPCs, obj) then
  61. table.insert(validNPCs, obj)
  62. end
  63. end
  64. end
  65.  
  66. local function handleDescendant(descendant)
  67. if isNPC(descendant) then
  68. table.insert(validNPCs, descendant)
  69. local humanoid = descendant:WaitForChild("Humanoid")
  70. humanoid.Destroying:Connect(function()
  71. for i = #validNPCs, 1, -1 do
  72. if validNPCs[i] == descendant then
  73. table.remove(validNPCs, i)
  74. break
  75. end
  76. end
  77. end)
  78. end
  79. end
  80.  
  81. workspace.DescendantAdded:Connect(handleDescendant)
  82.  
  83. local function updateDrawings()
  84. FOVring.Position = Cam.ViewportSize / 2
  85. FOVring.Radius = fov * (Cam.ViewportSize.Y / 1080)
  86. end
  87.  
  88. local function predictPos(target)
  89. local rootPart = target:FindFirstChild("HumanoidRootPart")
  90. local head = target:FindFirstChild("Head")
  91. if not rootPart or not head then
  92. return head and head.Position or rootPart and rootPart.Position
  93. end
  94. local velocity = rootPart.Velocity
  95. local predictionTime = 0.02
  96. local basePosition = rootPart.Position + velocity * predictionTime
  97. local headOffset = head.Position - rootPart.Position
  98. return basePosition + headOffset
  99. end
  100.  
  101. local function getTarget()
  102. local nearest = nil
  103. local minDistance = math.huge
  104. local viewportCenter = Cam.ViewportSize / 2
  105. raycastParams.FilterDescendantsInstances = {Player.Character}
  106. for _, npc in ipairs(validNPCs) do
  107. local predictedPos = predictPos(npc)
  108. local screenPos, visible = Cam:WorldToViewportPoint(predictedPos)
  109. if visible and screenPos.Z > 0 then
  110. local ray = workspace:Raycast(
  111. Cam.CFrame.Position,
  112. (predictedPos - Cam.CFrame.Position).Unit * 1000,
  113. raycastParams
  114. )
  115. if ray and ray.Instance:IsDescendantOf(npc) then
  116. local distance = (Vector2.new(screenPos.X, screenPos.Y) - viewportCenter).Magnitude
  117. if distance < minDistance and distance < fov then
  118. minDistance = distance
  119. nearest = npc
  120. end
  121. end
  122. end
  123. end
  124. return nearest
  125. end
  126.  
  127. local function aim(targetPosition)
  128. local currentCF = Cam.CFrame
  129. local targetDirection = (targetPosition - currentCF.Position).Unit
  130. local smoothFactor = 0.581
  131. local newLookVector = currentCF.LookVector:Lerp(targetDirection, smoothFactor)
  132. Cam.CFrame = CFrame.new(currentCF.Position, currentCF.Position + newLookVector)
  133. end
  134.  
  135. local heartbeat = RunService.Heartbeat
  136. local lastUpdate = 0
  137. local UPDATE_INTERVAL = 0.4
  138.  
  139. heartbeat:Connect(function(dt)
  140. updateDrawings()
  141. lastUpdate = lastUpdate + dt
  142. if lastUpdate >= UPDATE_INTERVAL then
  143. updateNPCs()
  144. lastUpdate = 0
  145. end
  146. if isAiming then
  147. local target = getTarget()
  148. if target then
  149. local predictedPosition = predictPos(target)
  150. aim(predictedPosition)
  151. end
  152. end
  153. end)
  154.  
  155. ToggleButton.MouseButton1Click:Connect(function()
  156. isAiming = not isAiming
  157. FOVring.Visible = isAiming
  158. ToggleButton.Text = "AIMBOT: " .. (isAiming and "ON" or "OFF")
  159. ToggleButton.TextColor3 = isAiming and Color3.fromRGB(50, 255, 50) or Color3.fromRGB(255, 50, 50)
  160. end)
  161.  
  162. local dragging, dragInput, dragStart, startPos
  163.  
  164. local function update(input)
  165. local delta = input.Position - dragStart
  166. ToggleButton.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  167. end
  168.  
  169. ToggleButton.InputBegan:Connect(function(input)
  170. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  171. dragging = true
  172. dragStart = input.Position
  173. startPos = ToggleButton.Position
  174. input.Changed:Connect(function()
  175. if input.UserInputState == Enum.UserInputState.End then
  176. dragging = false
  177. end
  178. end)
  179. end
  180. end)
  181.  
  182. ToggleButton.InputChanged:Connect(function(input)
  183. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  184. dragInput = input
  185. end
  186. end)
  187.  
  188. UserInputService.InputChanged:Connect(function(input)
  189. if input == dragInput and dragging then
  190. update(input)
  191. end
  192. end)
  193.  
  194. updateNPCs()
  195. workspace.DescendantRemoved:Connect(function(descendant)
  196. if isNPC(descendant) then
  197. for i = #validNPCs, 1, -1 do
  198. if validNPCs[i] == descendant then
  199. table.remove(validNPCs, i)
  200. break
  201. end
  202. end
  203. end
  204. end)
  205.  
  206. game:GetService("Players").PlayerRemoving:Connect(function()
  207. FOVring:Remove()
  208. ScreenGui:Destroy()
  209. end)
  210.  
  211.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement