Repository navigation
Expand file tree
/
Copy pathmain (1).lua
More file actions
324 lines (280 loc) · 12.3 KB
/
Copy pathmain (1).lua
File metadata and controls
324 lines (280 loc) · 12.3 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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
--- Roku Script - Final Version
-- description A comprehensive, multi-feature script for Roblox, built for performance and stability.
-- features Player Teleport, Movement Mods (Fly, Noclip, Speed), Visual ESP, and Keybinds.
-- Services:
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local localPlayer = Players.LocalPlayer
local mouse = localPlayer:GetMouse()
-- Configuration:
local Config = {
-- Feature state tracking
InfiniteJump = false,
IsFlying = false,
Noclip = false,
ESP = false,
ClickTeleport = false,
-- Customisable values
FlySpeed = 100,
WalkSpeed = 16,
-- User-defined keybinds
Keybinds = {
ToggleFly = Enum.KeyCode.F,
ToggleNoclip = Enum.KeyCode.V,
}
}
-- Private variables for managing script elements
local espElements = {} -- Stores ESP BillboardGuis for cleanup
local flyVelocity = nil -- Holds the LinearVelocity for flying
local noclipConnection = nil-- Holds the noclip RunService connection
local clickTpConnection = nil-- Holds the click teleport input connection
-- UI Setup:
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local Window = Rayfield:CreateWindow({
Name = "Roku Script - Final",
LoadingSubtitle = "by Roku",
ConfigurationSaving = { Enabled = true, FileName = "RokuScriptFinal" }
})
Rayfield:Notify({
Title = "Roku Script Loaded",
Content = "Welcome! All features are available in the UI.",
Duration = 8
})
-- Core Logic & Feature Toggles:
-- Handles character setup on spawn/respawn
local function setupCharacter(character)
pcall(function()
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = Config.WalkSpeed -- Apply saved walkspeed
-- Handle infinite jump logic
humanoid.StateChanged:Connect(function(_, newState)
if newState == Enum.HumanoidStateType.Jumping and Config.InfiniteJump then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)
end)
end
-- Toggles the state of flying
local function setFlying(enabled)
Config.IsFlying = enabled
local character = localPlayer.Character
if not character then return end
local rootPart = character:FindFirstChild("HumanoidRootPart")
if not rootPart then return end
if enabled then
local attachment = Instance.new("Attachment", rootPart)
flyVelocity = Instance.new("LinearVelocity", attachment)
flyVelocity.Attachment0 = attachment
flyVelocity.MaxForce = 100000
flyVelocity.VectorVelocity = Vector3.new(0, 0, 0)
else
if flyVelocity then
flyVelocity:Destroy()
flyVelocity = nil
end
end
Rayfield:Notify({Title = "Flying", Content = enabled and "Enabled" or "Disabled", Duration = 3})
end
-- Toggles the state of noclip
local function setNoclip(enabled)
Config.Noclip = enabled
if enabled then
noclipConnection = RunService.Stepped:Connect(function()
if not Config.Noclip or not localPlayer.Character then return end
for _, part in ipairs(localPlayer.Character:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = false
end
end
end)
else
if noclipConnection then
noclipConnection:Disconnect()
noclipConnection = nil
end
end
Rayfield:Notify({Title = "Noclip", Content = enabled and "Enabled" or "Disabled", Duration = 3})
end
-- Toggles the state of ESP
local function setESP(enabled)
Config.ESP = enabled
if not enabled then
-- Clean up all created ESP elements
for player, elements in pairs(espElements) do
if elements.Billboard then elements.Billboard:Destroy() end
if elements.Tracer then elements.Tracer:Destroy() end
end
espElements = {}
end
Rayfield:Notify({Title = "ESP", Content = enabled and "Enabled" or "Disabled", Duration = 3})
end
-- Toggles click teleport mode
local function setClickTeleport(enabled)
Config.ClickTeleport = enabled
if enabled then
Rayfield:Notify({Title = "Click Teleport", Content = "Enabled. Click anywhere to teleport.", Duration = 4})
clickTpConnection = mouse.Button1Down:Connect(function()
if not Config.ClickTeleport or not localPlayer.Character then return end
local rootPart = localPlayer.Character:FindFirstChild("HumanoidRootPart")
if rootPart then
rootPart.CFrame = CFrame.new(mouse.Hit.Position)
end
end)
else
if clickTpConnection then
clickTpConnection:Disconnect()
clickTpConnection = nil
end
Rayfield:Notify({Title = "Click Teleport", Content = "Disabled.", Duration = 3})
end
end
-- UI Element Creation:
-- Player Tab
local PlayerTab = Window:CreateTab("Player")
local TeleportSection = PlayerTab:CreateSection("Teleportation")
local playerDropdown = TeleportSection:CreateDropdown({
Name = "Select Player",
Options = {},
Callback = function() end,
})
TeleportSection:CreateButton({
Name = "Teleport to Player",
Callback = function()
local targetPlayer = Players:FindFirstChild(playerDropdown:Get())
if targetPlayer and targetPlayer.Character and localPlayer.Character then
local rootPart = localPlayer.Character:FindFirstChild("HumanoidRootPart")
local targetRootPart = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
if rootPart and targetRootPart then
rootPart.CFrame = targetRootPart.CFrame * CFrame.new(0, 3, 0)
Rayfield:Notify({Title = "Teleport", Content = "Success!", Duration = 3})
end
else
Rayfield:Notify({Title = "Teleport Error", Content = "Could not find player.", Duration = 4})
end
end,
})
TeleportSection:CreateToggle({Name = "Click Teleport Mode", CurrentValue = false, Callback = setClickTeleport})
-- Movement Tab
local MovementTab = Window:CreateTab("Movement")
local GeneralSection = MovementTab:CreateSection("General")
GeneralSection:CreateSlider({
Name = "Walk Speed",
Range = {16, 200},
Default = 16,
Callback = function(value)
Config.WalkSpeed = value
if localPlayer.Character and localPlayer.Character:FindFirstChild("Humanoid") then
localPlayer.Character.Humanoid.WalkSpeed = value
end
end,
})
GeneralSection:CreateToggle({
Name = "Infinite Jump",
CurrentValue = false,
Callback = function(v) Config.InfiniteJump = v Rayfield:Notify({Title = "Infinite Jump", Content = v and "On" or "Off", Duration = 3}) end,
})
local AirSection = MovementTab:CreateSection("Advanced")
AirSection:CreateSlider({
Name = "Fly Speed",
Range = {50, 500},
Default = 100,
Callback = function(v) Config.FlySpeed = v end,
})
AirSection:CreateToggle({Name = "Flying", CurrentValue = false, Callback = setFlying})
AirSection:CreateToggle({Name = "Noclip", CurrentValue = false, Callback = setNoclip})
-- Visuals Tab
local VisualsTab = Window:CreateTab("Visuals")
local ESPSection = VisualsTab:CreateSection("ESP")
ESPSection:CreateToggle({Name = "Player ESP", CurrentValue = false, Callback = setESP})
-- Update Loops:
RunService.RenderStepped:Connect(function()
-- Flying update loop
if Config.IsFlying and flyVelocity and localPlayer.Character then
local head = localPlayer.Character:FindFirstChild("Head")
if not head then return end
local moveVector = Vector3.new()
if UserInputService:IsKeyDown(Enum.KeyCode.W) then moveVector += head.CFrame.LookVector end
if UserInputService:IsKeyDown(Enum.KeyCode.S) then moveVector -= head.CFrame.LookVector end
if UserInputService:IsKeyDown(Enum.KeyCode.A) then moveVector -= head.CFrame.RightVector end
if UserInputService:IsKeyDown(Enum.KeyCode.D) then moveVector += head.CFrame.RightVector end
if UserInputService:IsKeyDown(Enum.KeyCode.E) then moveVector += Vector3.new(0, 1, 0) end
if UserInputService:IsKeyDown(Enum.KeyCode.Q) then moveVector -= Vector3.new(0, 1, 0) end
flyVelocity.VectorVelocity = (moveVector.Magnitude > 0 and moveVector.Unit or moveVector) * Config.FlySpeed
end
-- ESP update loop
if Config.ESP then
local camera = Workspace.CurrentCamera
for _, player in ipairs(Players:GetPlayers()) do
if player ~= localPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local rootPart = player.Character.HumanoidRootPart
local screenPos, onScreen = camera:WorldToScreenPoint(rootPart.Position)
if onScreen then
if not espElements[player] then espElements[player] = {} end
-- Create Billboard GUI if needed
if not espElements[player].Billboard or not espElements[player].Billboard.Parent then
local billboard = Instance.new("BillboardGui", player.Character)
billboard.Adornee = rootPart
billboard.Size = UDim2.new(0, 200, 0, 50)
billboard.AlwaysOnTop = true
local textLabel = Instance.new("TextLabel", billboard)
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextScaled = true
espElements[player].Billboard = billboard
espElements[player].TextLabel = textLabel
end
-- Create Tracer Line if needed
if not espElements[player].Tracer or not espElements[player].Tracer.Parent then
espElements[player].Tracer = Drawing.new("Line")
end
-- Update visuals
local distance = (camera.CFrame.Position - rootPart.Position).Magnitude
espElements[player].TextLabel.Text = string.format("%s [%.0fm]", player.Name, distance)
espElements[player].TextLabel.TextColor3 = player:GetTeamColor().Color
espElements[player].Tracer.Visible = true
espElements[player].Tracer.From = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y)
espElements[player].Tracer.To = Vector2.new(screenPos.X, screenPos.Y)
espElements[player].Tracer.Color = player:GetTeamColor().Color
espElements[player].Tracer.Thickness = 1
else
if espElements[player] and espElements[player].Tracer then
espElements[player].Tracer.Visible = false -- Hide tracer if off-screen
end
end
end
end
end
end)
-- Event Handling & Initialisation:
-- Handle keybinds
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end -- Ignore if user is typing in chat
if input.KeyCode == Config.Keybinds.ToggleFly then setFlying(not Config.IsFlying) end
if input.KeyCode == Config.Keybinds.ToggleNoclip then setNoclip(not Config.Noclip) end
end)
-- Keep the player list for the dropdown updated
local function updatePlayerList()
local playerNames = {}
for _, player in ipairs(Players:GetPlayers()) do
if player ~= localPlayer then table.insert(playerNames, player.Name) end
end
playerDropdown:SetOptions(playerNames)
end
Players.PlayerAdded:Connect(updatePlayerList)
Players.PlayerRemoving:Connect(function(player)
-- Clean up ESP elements for players who leave
if espElements[player] then
if espElements[player].Billboard then espElements[player].Billboard:Destroy() end
if espElements[player].Tracer then espElements[player].Tracer:Destroy() end
espElements[player] = nil
end
updatePlayerList()
end)
-- Initial setup
localPlayer.CharacterAdded:Connect(setupCharacter)
if localPlayer.Character then
setupCharacter(localPlayer.Character)
end
updatePlayerList() -- Populate player list on script execution