Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Dead Rails ESP Script (v1.6) 365 lines [THIS MIGHT/WILL BE OUTDATED, I DON'T HACK ANYMORE.]
- -- Press "[" LeftBracket, to toggle entity nametags
- -- Press "]" RightBracket, to toggle entity highlights
- -- Press "'" Quote, to toggle special item nametags (e.g. Bond & BankCombo)
- -- Press "P" to toggle Debug Mode
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local Workspace = game:GetService("Workspace")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local MaxDistance = 500 -- Adjust ESP range
- -- Toggle's
- local NametagsEnabled = true
- local HighlightingEnabled = true
- local SpecialItemNametagsEnabled = true
- -- Enemy base names
- local BaseEnemyNames = {
- "RevolverOutlaw", "TurretOutlaw", "ShotgunOutlaw", "RifleOutlaw",
- "Vampire", "Werewolf", "Wolf", "Walker", "Runner", "ZombieMiner",
- "ZombieSheriff", "Banker", "ArmoredZombie", "SkeletonMiner",
- "ZombieRevolverOfficer", "ZombieRevolverSoldier", "RunnerSoldier",
- "ZombieSwordOfficer", "WalkerSoldier", "CaptainPrescott",
- "Horse", "Unicorn", "NikolaTesla", "ZombieScientist"
- }
- -- Lookup tables and model prefixes
- local TargetNames = {}
- for _, name in pairs(BaseEnemyNames) do
- TargetNames[name] = true
- TargetNames["Model_" .. name] = true
- end
- -- Custom highlight colours for each enemy
- local HighlightColors = {
- Vampire = Color3.fromRGB(235, 59, 59),
- Werewolf = Color3.fromRGB(100, 100, 255),
- Wolf = Color3.fromRGB(150, 150, 255),
- Horse = Color3.fromRGB(150, 75, 0),
- Unicorn = Color3.fromRGB(235, 80, 240),
- RevolverOutlaw = Color3.fromRGB(255, 140, 0),
- RifleOutlaw = Color3.fromRGB(255, 140, 0),
- ShotgunOutlaw = Color3.fromRGB(255, 140, 0),
- TurretOutlaw = Color3.fromRGB(255, 139, 0),
- CaptainPrescott = Color3.fromRGB(59, 112, 235),
- ZombieMiner = Color3.fromRGB(82, 145, 81),
- ZombieRevolverOfficer = Color3.fromRGB(255, 105, 105),
- ZombieRevolverSoldier = Color3.fromRGB(255, 105, 105),
- ZombieSheriff = Color3.fromRGB(255, 105, 105),
- ZombieSwordOfficer = Color3.fromRGB(51, 196, 45),
- ArmoredZombie = Color3.fromRGB(51, 196, 45),
- Walker = Color3.fromRGB(51, 196, 45),
- WalkerSoldier = Color3.fromRGB(51, 196, 45),
- Runner = Color3.fromRGB(51, 196, 45),
- RunnerSoldier = Color3.fromRGB(51, 196, 45),
- NikolaTesla = Color3.fromRGB(157, 0, 255),
- Banker = Color3.fromRGB(47, 0, 255),
- }
- -- "Model" prefix strip
- local function StripModelPrefix(name)
- return name:match("^Model_(.+)$") or name
- end
- -- create nametag
- local function CreateNametag(Model)
- local Head = Model:FindFirstChild("Head")
- if not Head then return end
- if Head:FindFirstChild("Nametag") then
- Head.Nametag:Destroy()
- end
- local BillboardGui = Instance.new("BillboardGui")
- BillboardGui.Name = "Nametag"
- BillboardGui.Adornee = Head
- BillboardGui.Size = UDim2.new(0, 75, 0, 150)
- BillboardGui.StudsOffset = Vector3.new(0, 2, 0)
- BillboardGui.AlwaysOnTop = true
- local TextLabel = Instance.new("TextLabel")
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Text = StripModelPrefix(Model.Name)
- TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel.BackgroundTransparency = 1
- TextLabel.TextStrokeTransparency = 0.75
- TextLabel.Font = Enum.Font.Code
- TextLabel.TextScaled = true
- TextLabel.Parent = BillboardGui
- BillboardGui.Parent = Head
- -- Distance fade effect (in & out)
- local Connection
- Connection = RunService.Heartbeat:Connect(function()
- if not Model or not Head or not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("Head") then
- BillboardGui:Destroy()
- Connection:Disconnect()
- return
- end
- local distance = (Head.Position - LocalPlayer.Character.Head.Position).Magnitude
- BillboardGui.Enabled = NametagsEnabled and distance <= MaxDistance
- local alpha = math.clamp(1 - (distance / MaxDistance), 0, 1)
- TextLabel.TextTransparency = 1 - alpha
- TextLabel.TextStrokeTransparency = 0.75 + (1 - alpha) * 0.25
- end)
- end
- -- Highlight
- local function ApplyHighlight(Model)
- for _, v in pairs(Model:GetChildren()) do
- if v:IsA("Highlight") then v:Destroy() end
- end
- local Highlighter = Instance.new("Highlight")
- Highlighter.Name = "ESPHighlight"
- Highlighter.FillColor = HighlightColors[StripModelPrefix(Model.Name)] or Color3.fromRGB(255, 48, 51)
- Highlighter.OutlineColor = Color3.new(0, 0, 0)
- Highlighter.Enabled = HighlightingEnabled
- Highlighter.Parent = Model
- end
- -- Toggle inputs
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.LeftBracket then
- NametagsEnabled = not NametagsEnabled
- print("Nametags Enabled:", NametagsEnabled)
- for _, model in pairs(Workspace:GetDescendants()) do
- if TargetNames[model.Name] and model:IsA("Model") and model:FindFirstChild("Head") then
- local tag = model.Head:FindFirstChild("Nametag")
- if tag then tag.Enabled = NametagsEnabled end
- end
- end
- elseif input.KeyCode == Enum.KeyCode.RightBracket then
- HighlightingEnabled = not HighlightingEnabled
- print("Highlighting Enabled:", HighlightingEnabled)
- for _, model in pairs(Workspace:GetDescendants()) do
- if TargetNames[model.Name] and model:IsA("Model") then
- for _, v in pairs(model:GetChildren()) do
- if v:IsA("Highlight") and v.Name == "ESPHighlight" then
- v.Enabled = HighlightingEnabled
- end
- end
- end
- end
- elseif input.KeyCode == Enum.KeyCode.Quote then
- SpecialItemNametagsEnabled = not SpecialItemNametagsEnabled
- print("Special Item Nametags Enabled:", SpecialItemNametagsEnabled)
- for _, item in pairs(Workspace:FindFirstChild("RuntimeItems"):GetChildren()) do
- local tag = item:FindFirstChild("Nametag")
- if tag then tag.Enabled = SpecialItemNametagsEnabled end
- end
- end
- end)
- -- Esp to models
- local function ScanAndSetup()
- for _, model in pairs(Workspace:GetDescendants()) do
- if TargetNames[model.Name] and model:IsA("Model") and model:FindFirstChild("Head") then
- CreateNametag(model)
- ApplyHighlight(model)
- end
- end
- end
- -- Initial scan
- ScanAndSetup()
- -- Runtime watcher
- Workspace.DescendantAdded:Connect(function(desc)
- if desc:IsA("Model") and TargetNames[desc.Name] then
- task.wait(0.1)
- if desc:FindFirstChild("Head") then
- CreateNametag(desc)
- ApplyHighlight(desc)
- end
- end
- end)
- -- === SPECIAL ITEM ESP ===
- local SpecialItems = {
- Bond = Color3.fromRGB(255, 59, 59),
- BankCombo = Color3.fromRGB(101, 66, 255),
- }
- local function CreateSpecialItemNametag(model)
- if model:FindFirstChild("Nametag") then
- model.Nametag:Destroy()
- end
- local adornee = model:FindFirstChild("PrimaryPart") or model:FindFirstChildWhichIsA("BasePart")
- if not adornee then return end
- local BillboardGui = Instance.new("BillboardGui")
- BillboardGui.Name = "Nametag"
- BillboardGui.Adornee = adornee
- BillboardGui.Size = UDim2.new(0, 60, 0, 35)
- BillboardGui.StudsOffset = Vector3.new(0, 2.5, 0)
- BillboardGui.AlwaysOnTop = true
- local TextLabel = Instance.new("TextLabel")
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Text = model.Name
- TextLabel.TextColor3 = Color3.new(1, 1, 1)
- TextLabel.BackgroundTransparency = 1
- TextLabel.TextStrokeTransparency = 0.75
- TextLabel.Font = Enum.Font.Code
- TextLabel.TextScaled = true
- TextLabel.Parent = BillboardGui
- BillboardGui.Parent = model
- RunService.Heartbeat:Connect(function()
- if not adornee or not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("Head") then return end
- local distance = (adornee.Position - LocalPlayer.Character.Head.Position).Magnitude
- BillboardGui.Enabled = SpecialItemNametagsEnabled and distance <= MaxDistance
- local alpha = math.clamp(1 - (distance / MaxDistance), 0, 1)
- TextLabel.TextTransparency = 1 - alpha
- TextLabel.TextStrokeTransparency = 0.75 + (1 - alpha) * 0.25
- end)
- end
- local function PulseHighlight(model, color)
- local highlight = Instance.new("Highlight")
- highlight.Name = "ESPHighlight"
- highlight.FillColor = color
- highlight.OutlineColor = Color3.new(0, 0, 0)
- highlight.Parent = model
- local alpha = 0
- local direction = 1
- RunService.Heartbeat:Connect(function(dt)
- alpha += direction * dt
- if alpha >= 1 then
- alpha = 1
- direction = -1
- elseif alpha <= 0.2 then
- alpha = 0.2
- direction = 1
- end
- highlight.FillTransparency = 1 - alpha
- end)
- end
- local function HighlightSpecialItems()
- local runtimeFolder = Workspace:FindFirstChild("RuntimeItems")
- if not runtimeFolder then return end
- for _, item in pairs(runtimeFolder:GetChildren()) do
- if item:IsA("Model") and SpecialItems[item.Name] then
- for _, v in pairs(item:GetChildren()) do
- if v:IsA("Highlight") and v.Name == "ESPHighlight" then
- v:Destroy()
- end
- end
- PulseHighlight(item, SpecialItems[item.Name])
- CreateSpecialItemNametag(item)
- end
- end
- end
- HighlightSpecialItems()
- Workspace:WaitForChild("RuntimeItems").ChildAdded:Connect(function(child)
- if child:IsA("Model") and SpecialItems[child.Name] then
- task.wait(0.1)
- HighlightSpecialItems()
- end
- end)
- -- === DEBUG MODE TOGGLE ===
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local DebugMode = false
- local DebugGui = Instance.new("ScreenGui", LocalPlayer:WaitForChild("PlayerGui"))
- DebugGui.Name = "DebugGui"
- DebugGui.ResetOnSpawn = false
- -- Game Time UI
- local TimeLabel = Instance.new("TextLabel")
- TimeLabel.Size = UDim2.new(0, 200, 0, 40)
- TimeLabel.Position = UDim2.new(1, -210, 0, 10)
- TimeLabel.AnchorPoint = Vector2.new(0, 0)
- TimeLabel.BackgroundTransparency = 1
- TimeLabel.TextColor3 = Color3.new(1, 1, 1)
- TimeLabel.TextTransparency = 0.65
- TimeLabel.Font = Enum.Font.Code
- TimeLabel.TextScaled = true
- TimeLabel.Text = ""
- TimeLabel.Parent = DebugGui
- TimeLabel.Visible = false
- -- Debug Mode UI
- local DebugLabel = Instance.new("TextLabel")
- DebugLabel.Size = UDim2.new(0, 200, 0, 40)
- DebugLabel.Position = UDim2.new(1, -210, 1, -50)
- DebugLabel.AnchorPoint = Vector2.new(0, 1)
- DebugLabel.BackgroundTransparency = 1
- DebugLabel.TextColor3 = Color3.new(1, 1, 1)
- DebugLabel.TextTransparency = 0.65
- DebugLabel.Font = Enum.Font.Code
- DebugLabel.TextScaled = true
- DebugLabel.Text = "Debug Mode"
- DebugLabel.Parent = DebugGui
- DebugLabel.Visible = false
- -- Update time label
- RunService.Heartbeat:Connect(function()
- if DebugMode and TimeLabel.Visible then
- local timeVal = ReplicatedStorage:FindFirstChild("TimeHour")
- local fuelVal = Workspace:FindFirstChild("Train") and Workspace.Train:FindFirstChild("Fuel")
- if timeVal and timeVal:IsA("StringValue") then
- TimeLabel.Text = timeVal.Value
- end
- if fuelVal and fuelVal:IsA("IntValue") then
- FuelLabel.Text = "Fuel: " .. fuelVal.Value
- else
- FuelLabel.Text = "Fuel: N/A"
- end
- end
- end)
- -- Fuel UI
- local FuelLabel = Instance.new("TextLabel")
- FuelLabel.Size = UDim2.new(0, 200, 0, 40)
- FuelLabel.Position = UDim2.new(1, -210, 0, 50)
- FuelLabel.AnchorPoint = Vector2.new(0, 0)
- FuelLabel.BackgroundTransparency = 1
- FuelLabel.TextColor3 = Color3.new(1, 1, 1)
- FuelLabel.TextTransparency = 0.65
- FuelLabel.Font = Enum.Font.Code
- FuelLabel.TextScaled = true
- FuelLabel.Text = ""
- FuelLabel.Parent = DebugGui
- FuelLabel.Visible = false
- -- Toggle keybind (P)
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.P then
- DebugMode = not DebugMode
- DebugLabel.Visible = DebugMode
- TimeLabel.Visible = DebugMode
- if DebugMode then
- print("Debug Mode ON")
- UpdateDebugTags()
- else
- print("Debug Mode OFF")
- -- Clear debug tags
- for _, v in pairs(Workspace:GetDescendants()) do
- if v:IsA("BillboardGui") and v.Name == "DebugTag" then
- v:Destroy()
- end
- end
- end
- end
- end)
- -- AERQ1111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement