-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewScript.lua
More file actions
296 lines (267 loc) · 8.14 KB
/
Copy pathnewScript.lua
File metadata and controls
296 lines (267 loc) · 8.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
local Rayfield = loadstring(game:HttpGet("https://sirius.menu/rayfield"))()
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local workspace = game:GetService("Workspace")
local localPlayer = Players.LocalPlayer
local circle = Drawing.new("Circle")
-- Configuration Settings
local settings = {
aimbot = {
targetPart = "Head",
fallbackPart = "HumanoidRootPart",
enabled = false,
fov = {
show = true,
color = Color3.fromRGB(255, 0, 0),
thickness = 2,
transparency = 1,
degrees = 90
},
priorityRadius = 90
},
esp = {
enabled = false,
updateSpeed = 20,
aliveOnly = true,
customHighlights = true
},
nightVision = false,
noclip = false
}
-- Entity/Item Definitions
local definitions = {
entities = {
Model_Unicorn = {
name = "Unicorn",
highlight = "highlight",
tags = {}
},
Model_Banker = {
name = "Banker",
highlight = "highlight",
tags = { "aimbot", "enemy" }
},
Model_Werewolf = {
name = "Werewolf",
highlight = "warn",
tags = { "aimbot", "enemy" }
}
},
items = {
-- Add your item definitions here
-- Example:
-- Item_HealthPack = {
-- name = "Health Pack",
-- highlight = "highlight",
-- tags = {"heal"}
-- }
}
}
-- Runtime State
local state = {
connections = {},
esp = {
models = {},
labels = {},
userHighlights = {}
},
aimbot = {
targets = {}
}
}
-- Core Functions
local function updateLighting()
if settings.nightVision then
Lighting.Ambient = Color3.new(1, 1, 1)
Lighting.Brightness = 5
Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
else
Lighting.Ambient = Color3.new(0, 0, 0)
Lighting.Brightness = 2
Lighting.OutdoorAmbient = Color3.new(0, 0, 0)
end
end
local function createESP(model, definitionType)
if model:FindFirstChild("ESP_Added") then return end
local def = definitions[definitionType][model.Name]
if not def then return end
local highlight = state.esp.userHighlights[model.Name] or def.highlight
if highlight == "none" then return end
local color = Color3.new(1, 0, 0)
if highlight == "highlight" then
color = Color3.fromRGB(0, 255, 0)
elseif highlight == "warn" then
color = Color3.fromRGB(255, 255, 0)
end
for _, part in model:GetDescendants() do
if part:IsA("BasePart") then
local box = Instance.new("BoxHandleAdornment")
box.Size = part.Size
box.Adornee = part
box.AlwaysOnTop = true
box.ZIndex = 10
box.Transparency = 0.5
box.Color3 = color
box.Name = "ESPBox"
box.Parent = part
end
end
local head = model:FindFirstChild("Head")
if head and highlight ~= "ignore" then
local billboard = Instance.new("BillboardGui")
billboard.Name = "NameESP"
billboard.Size = UDim2.new(0, 150, 0, 40)
billboard.StudsOffset = Vector3.new(0, 2, 0)
billboard.AlwaysOnTop = true
billboard.Adornee = head
billboard.Parent = head
local nameLabel = Instance.new("TextLabel")
nameLabel.Size = UDim2.new(1, 0, 1, 0)
nameLabel.BackgroundTransparency = 1
nameLabel.TextColor3 = Color3.new(1, 1, 1)
nameLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
nameLabel.TextStrokeTransparency = 0.5
nameLabel.TextScaled = true
nameLabel.Font = Enum.Font.SourceSansBold
nameLabel.Text = def.name
nameLabel.Parent = billboard
if highlight == "warn" then
state.esp.labels[model] = nameLabel
end
end
Instance.new("BoolValue", model).Name = "ESP_Added"
table.insert(state.esp.models, model)
end
local function clearESP()
for _, model in pairs(state.esp.models) do
if model.Parent then
for _, part in model:GetDescendants() do
if part:IsA("BoxHandleAdornment") or part:IsA("BillboardGui") then
part:Destroy()
end
end
end
end
state.esp.models = {}
state.esp.labels = {}
end
-- UI Setup
local Window = Rayfield:CreateWindow({
Name = "Dead Rails Script",
LoadingTitle = "Dead Rails Script",
LoadingSubtitle = "by Zzza38",
ConfigurationSaving = { Enabled = true, FileName = "dead-rails" }
})
local generalTab = Window:CreateTab("General", 140020355535548)
local espTab = Window:CreateTab("ESP", 122410053148023)
local aimbotTab = Window:CreateTab("Aimbot", 90837964489774)
-- General Tab
generalTab:CreateToggle({
Name = "Night Vision",
CurrentValue = settings.nightVision,
Callback = function(value)
settings.nightVision = value
updateLighting()
end
})
generalTab:CreateToggle({
Name = "Noclip",
CurrentValue = settings.noclip,
Callback = function(value)
settings.noclip = value
end
})
-- ESP Tab
espTab:CreateToggle({
Name = "ESP",
CurrentValue = settings.esp.enabled,
Callback = function(value)
settings.esp.enabled = value
if not value then clearESP() end
end
})
local entityOptions = {}
for _, def in pairs(definitions.entities) do
table.insert(entityOptions, def.name)
end
espTab:CreateDropdown({
Name = "Entity Highlight Modes",
Options = entityOptions,
Callback = function(selected)
local internalName
for name, def in pairs(definitions.entities) do
if def.name == selected then
internalName = name
break
end
end
espTab:CreateDropdown({
Name = "Highlight Mode",
Options = {"Highlight", "Warn", "Ignore", "None"},
Callback = function(mode)
state.esp.userHighlights[internalName] = mode:lower()
clearESP()
end
})
end
})
-- Aimbot Tab
aimbotTab:CreateToggle({
Name = "Aimbot",
CurrentValue = settings.aimbot.enabled,
Callback = function(value)
settings.aimbot.enabled = value
circle.Visible = value and settings.aimbot.fov.show
end
})
aimbotTab:CreateColorPicker({
Name = "FOV Color",
Color = settings.aimbot.fov.color,
Callback = function(value)
settings.aimbot.fov.color = value
circle.Color = value
end
})
-- Main Loop
table.insert(state.connections, RunService.RenderStepped:Connect(function()
-- ESP Update
if settings.esp.enabled then
for _, model in workspace:GetChildren() do
if model:IsA("Model") and model:FindFirstChild("Humanoid") then
if model:FindFirstChild("ESP_Added") then continue end
if Players:GetPlayerFromCharacter(model) then continue end
if definitions.entities[model.Name] then
createESP(model, "entities")
elseif definitions.items[model.Name] then
createESP(model, "items")
end
end
end
end
-- Aimbot Logic
circle.Visible = settings.aimbot.enabled and settings.aimbot.fov.show
circle.Radius = math.tan(math.rad(settings.aimbot.fov.degrees/2)) * workspace.CurrentCamera.ViewportSize.X
circle.Position = Vector2.new(
workspace.CurrentCamera.ViewportSize.X/2,
workspace.CurrentCamera.ViewportSize.Y/2
)
-- Noclip Logic
if settings.noclip and localPlayer.Character then
for _, part in localPlayer.Character:GetDescendants() do
if part:IsA("BasePart") then
part.CanCollide = false
end
end
end
end))
-- Cleanup
Rayfield:LoadConfiguration()
game:GetService("Unloaded"):Connect(function()
clearESP()
for _, conn in pairs(state.connections) do
conn:Disconnect()
end
circle:Remove()
end)