dats-scythe

Dead rails Op script

Feb 24th, 2025
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.87 KB | None | 0 0
  1. local success, Rayfield = pcall(function()
  2. return loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  3. end)
  4.  
  5. if not success or not Rayfield then
  6. warn("Failed to load Rayfield UI Library!")
  7. return
  8. end
  9.  
  10. local Window = Rayfield:CreateWindow({
  11. Name = "Dead Rails v1.3",
  12. Icon = 0, -- Icon in Topbar. Can use Lucide Icons (string) or Roblox Image (number). 0 to use no icon (default).
  13. LoadingTitle = "Dead Rails",
  14. LoadingSubtitle = "by Reallance0424",
  15. Theme = "Default", -- Check https://docs.sirius.menu/rayfield/configuration/themes
  16.  
  17. DisableRayfieldPrompts = false,
  18. DisableBuildWarnings = false, -- Prevents Rayfield from warning when the script has a version mismatch with the interface
  19.  
  20. ConfigurationSaving = {
  21. Enabled = true,
  22. FolderName = nil, -- Create a custom folder for your hub/game
  23. FileName = "Big Hub"
  24. },
  25.  
  26. Discord = {
  27. Enabled = false, -- Prompt the user to join your Discord server if their executor supports it
  28. Invite = "noinvitelink", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ ABCD would be ABCD
  29. RememberJoins = true -- Set this to false to make them join the discord every time they load it up
  30. },
  31.  
  32. KeySystem = false, -- Set this to true to use our key system
  33. KeySettings = {
  34. Title = "Untitled",
  35. Subtitle = "Key System",
  36. Note = "No method of obtaining the key is provided", -- Use this to tell the user how to get a key
  37. FileName = "Key", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
  38. SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script
  39. GrabKeyFromSite = false, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
  40. Key = {"Hello"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
  41. }
  42. })
  43.  
  44. local MainTab = Window:CreateTab("Main", 4483362458) -- Title, Image
  45.  
  46. local RunService = game:GetService("RunService")
  47. local Cam = workspace.CurrentCamera
  48. local Player = game:GetService("Players").LocalPlayer
  49.  
  50. local validNPCs = {}
  51. local raycastParams = RaycastParams.new()
  52. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  53.  
  54. local function isNPC(obj)
  55. return obj:IsA("Model")
  56. and obj:FindFirstChild("Humanoid")
  57. and obj.Humanoid.Health > 0
  58. and obj:FindFirstChild("Head")
  59. and obj:FindFirstChild("HumanoidRootPart")
  60. and not game:GetService("Players"):GetPlayerFromCharacter(obj)
  61. end
  62.  
  63. local function updateNPCs()
  64. local tempTable = {}
  65. for _, obj in ipairs(workspace:GetDescendants()) do
  66. if isNPC(obj) then
  67. tempTable[obj] = true
  68. end
  69. end
  70. for i = #validNPCs, 1, -1 do
  71. if not tempTable[validNPCs[i]] then
  72. table.remove(validNPCs, i)
  73. end
  74. end
  75. for obj in pairs(tempTable) do
  76. if not table.find(validNPCs, obj) then
  77. table.insert(validNPCs, obj)
  78. end
  79. end
  80. end
  81.  
  82. local function handleDescendant(descendant)
  83. if isNPC(descendant) then
  84. table.insert(validNPCs, descendant)
  85. local humanoid = descendant:WaitForChild("Humanoid")
  86. humanoid.Destroying:Connect(function()
  87. for i = #validNPCs, 1, -1 do
  88. if validNPCs[i] == descendant then
  89. table.remove(validNPCs, i)
  90. break
  91. end
  92. end
  93. end)
  94. end
  95. end
  96.  
  97. workspace.DescendantAdded:Connect(handleDescendant)
  98.  
  99. local function predictPos(target)
  100. local rootPart = target:FindFirstChild("HumanoidRootPart")
  101. local head = target:FindFirstChild("Head")
  102. if not rootPart or not head then
  103. return head and head.Position or rootPart and rootPart.Position
  104. end
  105. local velocity = rootPart.Velocity
  106. local predictionTime = 0.02
  107. local basePosition = rootPart.Position + velocity * predictionTime
  108. local headOffset = head.Position - rootPart.Position
  109. return basePosition + headOffset
  110. end
  111.  
  112. local function getTarget()
  113. local nearest = nil
  114. local minDistance = math.huge
  115. local viewportCenter = Cam.ViewportSize / 2
  116. raycastParams.FilterDescendantsInstances = {Player.Character}
  117. for _, npc in ipairs(validNPCs) do
  118. local predictedPos = predictPos(npc)
  119. local screenPos, visible = Cam:WorldToViewportPoint(predictedPos)
  120. if visible and screenPos.Z > 0 then
  121. local ray = workspace:Raycast(
  122. Cam.CFrame.Position,
  123. (predictedPos - Cam.CFrame.Position).Unit * 500,
  124. raycastParams
  125. )
  126. if ray and ray.Instance:IsDescendantOf(npc) then
  127. local distance = (Vector2.new(screenPos.X, screenPos.Y) - viewportCenter).Magnitude
  128. if distance < minDistance then
  129. minDistance = distance
  130. nearest = npc
  131. end
  132. end
  133. end
  134. end
  135. return nearest
  136. end
  137.  
  138. local function aim(targetPosition)
  139. local currentCF = Cam.CFrame
  140. local targetDirection = (targetPosition - currentCF.Position).Unit
  141. local smoothFactor = 0.581
  142. local newLookVector = currentCF.LookVector:Lerp(targetDirection, smoothFactor)
  143. Cam.CFrame = CFrame.new(currentCF.Position, currentCF.Position + newLookVector)
  144. end
  145.  
  146. local heartbeat = RunService.Heartbeat
  147. local lastUpdate = 0
  148. local UPDATE_INTERVAL = 0.4
  149.  
  150. local aimbotEnabled = false
  151.  
  152. heartbeat:Connect(function(dt)
  153. lastUpdate = lastUpdate + dt
  154. if lastUpdate >= UPDATE_INTERVAL then
  155. updateNPCs()
  156. lastUpdate = 0
  157. end
  158. if aimbotEnabled then
  159. local target = getTarget()
  160. if target then
  161. local predictedPosition = predictPos(target)
  162. aim(predictedPosition)
  163. end
  164. end
  165. end)
  166.  
  167. workspace.DescendantRemoving:Connect(function(descendant)
  168. if isNPC(descendant) then
  169. for i = #validNPCs, 1, -1 do
  170. if validNPCs[i] == descendant then
  171. table.remove(validNPCs, i)
  172. break
  173. end
  174. end
  175. end
  176. end)
  177.  
  178. local aimbotToggle = MainTab:CreateToggle({
  179. Name = "Aimbot",
  180. CurrentValue = false,
  181. Flag = "AimbotToggle",
  182. Callback = function(Value)
  183. aimbotEnabled = Value
  184. end
  185. })
  186.  
  187. local ESPHandles = {}
  188. local ESPEnabled = false
  189.  
  190. local function CreateESP(object, color)
  191. if not object or not object.PrimaryPart then return end
  192.  
  193. local highlight = Instance.new("Highlight")
  194. highlight.Name = "ESP_Highlight"
  195. highlight.Adornee = object
  196. highlight.FillColor = color
  197. highlight.OutlineColor = color
  198. highlight.Parent = object
  199.  
  200. local billboard = Instance.new("BillboardGui")
  201. billboard.Name = "ESP_Billboard"
  202. billboard.Adornee = object.PrimaryPart
  203. billboard.Size = UDim2.new(0, 200, 0, 50)
  204. billboard.StudsOffset = Vector3.new(0, 5, 0)
  205. billboard.AlwaysOnTop = true
  206. billboard.Parent = object
  207.  
  208. local textLabel = Instance.new("TextLabel")
  209. textLabel.Text = object.Name
  210. textLabel.Size = UDim2.new(1, 0, 1, 0)
  211. textLabel.TextColor3 = color
  212. textLabel.BackgroundTransparency = 1
  213. textLabel.TextSize = 7
  214. textLabel.Parent = billboard
  215.  
  216. ESPHandles[object] = {Highlight = highlight, Billboard = billboard}
  217. end
  218.  
  219. local function ClearESP()
  220. for obj, handles in pairs(ESPHandles) do
  221. if handles.Highlight then handles.Highlight:Destroy() end
  222. if handles.Billboard then handles.Billboard:Destroy() end
  223. end
  224. ESPHandles = {}
  225. end
  226.  
  227. local function UpdateESP()
  228. ClearESP()
  229.  
  230. -- ESP for Items
  231. local runtimeItems = workspace:FindFirstChild("RuntimeItems")
  232. if runtimeItems then
  233. for _, item in ipairs(runtimeItems:GetDescendants()) do
  234. if item:IsA("Model") then
  235. CreateESP(item, Color3.new(1, 0, 0))
  236. end
  237. end
  238. end
  239.  
  240. -- ESP mobs
  241. local baseplates = workspace:FindFirstChild("Baseplates")
  242. if baseplates and #baseplates:GetChildren() >= 2 then
  243. local secondBaseplate = baseplates:GetChildren()[2]
  244. local centerBaseplate = secondBaseplate and secondBaseplate:FindFirstChild("CenterBaseplate")
  245. local animals = centerBaseplate and centerBaseplate:FindFirstChild("Animals")
  246. if animals then
  247. for _, animal in ipairs(animals:GetDescendants()) do
  248. if animal:IsA("Model") then
  249. CreateESP(animal, Color3.new(1, 0, 1)) -- Purple for Animals
  250. end
  251. end
  252. end
  253. end
  254.  
  255. local nightEnemies = workspace:FindFirstChild("NightEnemies")
  256. if nightEnemies then
  257. for _, enemy in ipairs(nightEnemies:GetDescendants()) do
  258. if enemy:IsA("Model") then
  259. CreateESP(enemy, Color3.new(0, 0, 1)) -- Blue for Night Enemies
  260. end
  261. end
  262. end
  263.  
  264. local destroyedHouse = workspace:FindFirstChild("RandomBuildings") and workspace.RandomBuildings:FindFirstChild("DestroyedHouse")
  265. local zombiePart = destroyedHouse and destroyedHouse:FindFirstChild("StandaloneZombiePart")
  266. local zombies = zombiePart and zombiePart:FindFirstChild("Zombies")
  267. if zombies then
  268. for _, zombie in ipairs(zombies:GetChildren()) do
  269. if zombie:IsA("Model") then
  270. CreateESP(zombie, Color3.new(0, 1, 0)) -- Green for Zombies
  271. end
  272. end
  273. end
  274. end
  275.  
  276. local function AutoUpdateESP()
  277. while ESPEnabled do
  278. UpdateESP()
  279. wait()
  280. end
  281. end
  282.  
  283. local espToggle = MainTab:CreateToggle({
  284. Name = "Trace Item and Mobs",
  285. CurrentValue = false,
  286. Flag = "ItemandMobsToggle",
  287. Callback = function(Value)
  288. ESPEnabled = Value
  289. if Value then
  290. UpdateESP()
  291. coroutine.wrap(AutoUpdateESP)()
  292. else
  293. ClearESP()
  294. end
  295. end
  296. })
  297.  
  298. local Tab = Window:CreateTab("Bring Item", 4483362458)
  299.  
  300. local function GetItemNames()
  301. local items = {}
  302. local runtimeItems = workspace:FindFirstChild("RuntimeItems")
  303. if runtimeItems then
  304. for _, item in ipairs(runtimeItems:GetDescendants()) do
  305. if item:IsA("Model") then
  306. table.insert(items, item.Name)
  307. end
  308. end
  309. else
  310. warn("RuntimeItems folder not found!")
  311. end
  312. return items
  313. end
  314.  
  315. local Dropdown = Tab:CreateDropdown({
  316. Name = "Choose item",
  317. Options = GetItemNames(),
  318. CurrentOption = "Select an item",
  319. MultipleOptions = false,
  320. Flag = "ItemDropdown",
  321. Callback = function(selectedItem)
  322. if type(selectedItem) == "table" then
  323. selectedItem = selectedItem[1]
  324. end
  325. end,
  326. })
  327.  
  328. local RefreshButton = Tab:CreateButton({
  329. Name = "Refresh Items",
  330. Callback = function()
  331. Dropdown:Refresh(GetItemNames())
  332. end,
  333. })
  334.  
  335. local collectButton = Tab:CreateButton({
  336. Name = "Collect Selected Item",
  337. Callback = function()
  338. local selectedItemName = Dropdown.CurrentOption
  339. if type(selectedItemName) == "table" then
  340. selectedItemName = selectedItemName[1]
  341. end
  342.  
  343. if selectedItemName == "Select an item" then
  344. warn("No item selected!")
  345. return
  346. end
  347.  
  348. local runtimeItems = workspace:FindFirstChild("RuntimeItems")
  349. if not runtimeItems then
  350. warn("RuntimeItems folder not found!")
  351. return
  352. end
  353.  
  354. local selectedItem
  355. for _, item in ipairs(runtimeItems:GetDescendants()) do
  356. if item:IsA("Model") and item.Name == selectedItemName then
  357. selectedItem = item
  358. break
  359. end
  360. end
  361.  
  362. if not selectedItem then
  363. warn("Item not found in RuntimeItems:", selectedItemName)
  364. return
  365. end
  366.  
  367. local Players = game:GetService("Players")
  368. local LocalPlayer = Players.LocalPlayer
  369. if not LocalPlayer then
  370. warn("LocalPlayer not found!")
  371. return
  372. end
  373.  
  374. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  375. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  376.  
  377. if not selectedItem.PrimaryPart then
  378. warn(selectedItem.Name .. " has no PrimaryPart and cannot be moved.")
  379. return
  380. end
  381.  
  382. selectedItem:SetPrimaryPartCFrame(HumanoidRootPart.CFrame + Vector3.new(0, 1, 0))
  383. print("Collected:", selectedItem.Name)
  384. end,
  385. })
  386.  
  387. local Section = Tab:CreateSection("Laggy or crash")
  388. local collectAllButton = Tab:CreateButton({
  389. Name = "Collect All Items",
  390. Callback = function()
  391. local runtimeItems = workspace:FindFirstChild("RuntimeItems")
  392. if not runtimeItems then
  393. warn("RuntimeItems folder not found!")
  394. return
  395. end
  396.  
  397. local ps = game:GetService("Players").LocalPlayer
  398. local ch = ps.Character or ps.CharacterAdded:Wait()
  399. local HumanoidRootPart = ch:WaitForChild("HumanoidRootPart")
  400.  
  401. for _, item in ipairs(runtimeItems:GetDescendants()) do
  402. if item:IsA("Model") then
  403. if item.PrimaryPart then
  404. local offset = HumanoidRootPart.CFrame.LookVector * 5
  405. item:SetPrimaryPartCFrame(HumanoidRootPart.CFrame + offset)
  406. else
  407. warn(item.Name .. " has no PrimaryPart .")
  408. end
  409. end
  410. end
  411. end,
  412. })
  413.  
  414. local OthersTab = Window:CreateTab("Others", 4483362458) -- Change ID if needed
  415. local Section = Tab:CreateSection("Irreversible")
  416. local Players = game:GetService("Players")
  417. local Lighting = game:GetService("Lighting")
  418. local RunService = game:GetService("RunService")
  419.  
  420. local player = Players.LocalPlayer
  421. local character = player.Character or player.CharacterAdded:Wait()
  422. local humanoid = character:WaitForChild("Humanoid")
  423. local rootPart = character:WaitForChild("HumanoidRootPart")
  424.  
  425. -- Variables
  426. local speedEnabled = false
  427. local speedValue = 16
  428. local fullBrightEnabled = false
  429. local floatEnabled = false
  430. local floatBodyPosition = nil
  431.  
  432. -- Speed Boost Toggle
  433. local SpeedToggle = OthersTab:CreateToggle({
  434. Name = "Speed Boost",
  435. CurrentValue = false,
  436. Flag = "SpeedToggle",
  437. Callback = function(Value)
  438. speedEnabled = Value
  439. humanoid.WalkSpeed = speedEnabled and speedValue or 16 -- Update speed
  440. end,
  441. })
  442.  
  443. -- Walkspeed Slider
  444. local SpeedSlider = OthersTab:CreateSlider({
  445. Name = "Walkspeed",
  446. Range = {16, 500},
  447. Increment = 1,
  448. Suffix = " Walkspeed",
  449. CurrentValue = 16,
  450. Flag = "SpeedSlider",
  451. Callback = function(v)
  452. speedValue = v
  453. if speedEnabled then
  454. humanoid.WalkSpeed = speedValue
  455. end
  456. end,
  457. })
  458.  
  459.  
  460. local BrightToggle = OthersTab:CreateToggle({
  461. Name = "Full Bright",
  462. CurrentValue = false,
  463. Flag = "FullBrightToggle",
  464. Callback = function(Value)
  465. fullBrightEnabled = Value
  466. if fullBrightEnabled then
  467. Lighting.Brightness = 2
  468. Lighting.ClockTime = 12
  469. Lighting.FogEnd = 100000
  470. Lighting.GlobalShadows = false
  471. else
  472. Lighting.Brightness = 1
  473. Lighting.ClockTime = 14
  474. Lighting.FogEnd = 1000
  475. Lighting.GlobalShadows = true
  476. end
  477. end,
  478. })
  479.  
  480. -- Floating (R6) Toggle
  481. local FloatToggle = OthersTab:CreateToggle({
  482. Name = "Float (R6 Only)",
  483. CurrentValue = false,
  484. Flag = "FloatToggle",
  485. Callback = function(Value)
  486. floatEnabled = Value
  487. if floatEnabled and humanoid.RigType == Enum.HumanoidRigType.R6 then
  488. if not floatBodyPosition then
  489. floatBodyPosition = Instance.new("BodyPosition")
  490. floatBodyPosition.MaxForce = Vector3.new(0, math.huge, 0)
  491. floatBodyPosition.Position = rootPart.Position + Vector3.new(0, 5, 0)
  492. floatBodyPosition.Parent = rootPart
  493. end
  494. else
  495. if floatBodyPosition then
  496. floatBodyPosition:Destroy()
  497. floatBodyPosition = nil
  498. end
  499. end
  500. end,
  501. })
  502.  
  503. -- Fix for Respawn (Reapply Speed & Float)
  504. player.CharacterAdded:Connect(function(newCharacter)
  505. character = newCharacter
  506. humanoid = character:WaitForChild("Humanoid")
  507. rootPart = character:WaitForChild("HumanoidRootPart")
  508.  
  509. task.wait(1) -- Wait to load fully
  510. if speedEnabled then humanoid.WalkSpeed = speedValue end
  511. if floatEnabled and humanoid.RigType == Enum.HumanoidRigType.R6 then
  512. if not floatBodyPosition then
  513. floatBodyPosition = Instance.new("BodyPosition")
  514. floatBodyPosition.MaxForce = Vector3.new(0, math.huge, 0)
  515. floatBodyPosition.Position = rootPart.Position + Vector3.new(0, 5, 0)
  516. floatBodyPosition.Parent = rootPart
  517. end
  518. end
  519. end)
  520.  
  521. local Toggle = OthersTab:CreateToggle({
  522. Name = "Infinite Jump",
  523. CurrentValue = false,
  524. Flag = "Toggle1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  525. Callback = function(InfiniteJumpEnabled)
  526. local InfiniteJumpEnabled = true
  527. game:GetService("UserInputService").JumpRequest:connect(function()
  528. if InfiniteJumpEnabled then
  529. game:GetService"Players".LocalPlayer.Character:FindFirstChildOfClass'Humanoid':ChangeState("Jumping")
  530. end
  531. end)
  532. end,
  533. })
  534.  
  535. local Button = OthersTab:CreateButton({
  536. Name = "Unlock Third Person",
  537. Callback = function()
  538. local player = game:GetService("Players").LocalPlayer
  539. if player then
  540. player.CameraMaxZoomDistance = 200
  541. player.CameraMode = Enum.CameraMode.Classic
  542. else
  543. warn("LocalPlayer not found!")
  544. end
  545. end,
  546. })
Add Comment
Please, Sign In to add comment