NCXKayy

Fe Universal Menu

Jun 10th, 2025
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.54 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local RunService = game:GetService("RunService")
  3.  
  4. local function getCharacter()
  5. return player.Character or player.CharacterAdded:Wait()
  6. end
  7.  
  8. local Character = getCharacter()
  9. local Humanoid = Character:WaitForChild("Humanoid")
  10. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  11.  
  12. -- Tải Rayfield từ nguồn trực tuyến
  13. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  14.  
  15. local soundMenu = Instance.new("Sound", game.Players.LocalPlayer:WaitForChild("PlayerGui"))
  16. soundMenu.SoundId = "rbxassetid://8120936755"
  17. soundMenu.Volume = 1
  18.  
  19. local sound = Instance.new("Sound", game.Players.LocalPlayer:WaitForChild("PlayerGui"))
  20. sound.SoundId = "rbxassetid://3779053277"
  21. sound.Volume = 1
  22.  
  23. soundMenu:Play()
  24. -- Tạo một chủ đề tùy chỉnh
  25. -- Đây là nơi bạn định nghĩa màu sắc và giao diện cho menu của mình
  26. local CustomTheme = {
  27. TextColor = Color3.fromRGB(255, 255, 255), -- Màu chữ trắng
  28. Background = Color3.fromRGB(0, 0, 0), -- Màu nền đen
  29. Topbar = Color3.fromRGB(34, 34, 34), -- Màu thanh trên cùng
  30. Shadow = Color3.fromRGB(255, 255, 255), -- Hiệu ứng bóng
  31. NotificationBackground = Color3.fromRGB(20, 20, 20), -- Nền của thông báo
  32. NotificationActionsBackground = Color3.fromRGB(230, 230, 230), -- Nền của khu vực hành động thông báo
  33. TabBackground = Color3.fromRGB(0, 128, 0), -- Màu xanh lá cây cho tab
  34. TabStroke = Color3.fromRGB(255, 255, 255), -- Viền tab màu trắng
  35. TabBackgroundSelected = Color3.fromRGB(0, 128, 0), -- Màu xanh lá sáng hơn khi tab được chọn
  36. TabTextColor = Color3.fromRGB(255, 255, 255), -- Màu chữ trắng trong tab
  37. SelectedTabTextColor = Color3.fromRGB(255, 255, 255), -- Màu chữ đen khi tab được chọn
  38. ElementBackground = Color3.fromRGB(35, 35, 35), -- Nền của từng phần tử giao diện
  39. ElementBackgroundHover = Color3.fromRGB(40, 40, 40), -- Nền phần tử khi di chuột vào
  40. SecondaryElementBackground = Color3.fromRGB(25, 25, 25), -- Nền của phần tử phụ
  41. ElementStroke = Color3.fromRGB(255, 255, 255), -- Viền phần tử màu trắng
  42. SecondaryElementStroke = Color3.fromRGB(40, 40, 40), -- Viền phần tử phụ
  43. SliderBackground = Color3.fromRGB(255, 215, 0), -- Nền thanh trượt màu vàng
  44. SliderProgress = Color3.fromRGB(255, 215, 0), -- Màu tiến trình thanh trượt vàng
  45. SliderStroke = Color3.fromRGB(255, 255, 0), -- Viền thanh trượt màu vàng sáng hơn
  46. ToggleBackground = Color3.fromRGB(30, 30, 30), -- Nền nút bật/tắt
  47. ToggleEnabled = Color3.fromRGB(0, 146, 214), -- Màu khi bật
  48. ToggleDisabled = Color3.fromRGB(100, 100, 100), -- Màu khi tắt
  49. ToggleEnabledStroke = Color3.fromRGB(255, 255, 255), -- Viền khi bật
  50. ToggleDisabledStroke = Color3.fromRGB(255, 255, 255), -- Viền khi tắt
  51. ToggleEnabledOuterStroke = Color3.fromRGB(255, 255, 255), -- Viền ngoài khi bật
  52. ToggleDisabledOuterStroke = Color3.fromRGB(255, 255, 255), -- Viền ngoài khi tắt
  53. DropdownSelected = Color3.fromRGB(40, 40, 40), -- Màu khi mục dropdown được chọn
  54. DropdownUnselected = Color3.fromRGB(30, 30, 30), -- Màu khi mục dropdown chưa được chọn
  55. InputBackground = Color3.fromRGB(30, 30, 30), -- Nền của ô nhập liệu
  56. InputStroke = Color3.fromRGB(255, 255, 255), -- Viền của ô nhập liệu
  57. PlaceholderColor = Color3.fromRGB(178, 178, 178) -- Màu chữ gợi ý trong ô nhập liệu
  58. }
  59.  
  60.  
  61. -- Tạo cửa sổ giao diện chính với chủ đề tùy chỉnh
  62. local Window = Rayfield:CreateWindow({
  63. Name = "Fe Universal Menu V1", -- Tên của cửa sổ giao diện
  64. Icon = 0, -- ID icon (có thể thay đổi)
  65. LoadingTitle = "Loading......", -- Tiêu đề khi đang tải
  66. LoadingSubtitle = "by NCXKayy", -- Dòng phụ khi tải
  67. Theme = CustomTheme, -- Áp dụng chủ đề tùy chỉnh
  68. ToggleUIKeybind = "K", -- Phím tắt để bật/tắt giao diện
  69. DisableRayfieldPrompts = false, -- Tắt thông báo mặc định của Rayfield nếu cần
  70. DisableBuildWarnings = false, -- Tắt cảnh báo biên dịch nếu muốn
  71. ConfigurationSaving = { -- Cấu hình lưu trữ
  72. Enabled = true, -- Bật lưu cấu hình
  73. FolderName = "ThaytuberVN_Hub", -- Tên thư mục lưu
  74. FileName = "ThaytuberVN Hub" -- Tên tệp cấu hình
  75. },
  76.  
  77. KeySystem = false, -- Bật hệ thống key
  78. KeySettings = {
  79. Title = "Fe Universal Menu | Key",
  80. Subtitle = "Key có trong server Discord",
  81. Note = "Tham gia server để lấy key",
  82. FileName = "Key", -- Tên file lưu key
  83. SaveKey = true, -- Lưu key của người dùng
  84. GrabKeyFromSite = false, -- Lấy key từ trang web
  85. Key = {"thaytubervn"} -- Danh sách key hợp lệ
  86. }
  87. })
  88.  
  89. -- Tạo các tab trong giao diện
  90. local Tab1 = Window:CreateTab("Players", 4483362458) -- Tab quản lý người chơi
  91. local Tab2 = Window:CreateTab("Aimbot", 4483362458) -- Tab dành cho các tùy chỉnh ESP
  92. local Tab3 = Window:CreateTab("ESP", 4483362458) -- Tab để chạy script tùy chỉnh
  93. -----------------------
  94. local flying = false
  95. local invisible_enabled = false
  96. local invis_on = false
  97. local Noclip = false
  98. local TeleportEnabled = false
  99. local InfiniteJumpEnabled = false
  100. local following = false -- Biến kiểm soát trạng thái theo dõi
  101. local FullBrightEnabled = false
  102. local viewingPlayer = false
  103. local FlySpeed = 100 -- Giá trị tốc độ mặc định
  104.  
  105. local UserInputService = game:GetService("UserInputService")
  106. local originalAmbient = game:GetService("Lighting").Ambient
  107. local originalBrightness = game:GetService("Lighting").Brightness
  108. local originalFogEnd = game:GetService("Lighting").FogEnd
  109. local originalCameraSubject = game.Workspace.CurrentCamera.CameraSubject
  110. local nega = true
  111. local SelectedPlayer = nil
  112. --! Nút chọn ngẫu nhiên người chơi
  113. local lastSelectedPlayers = {} -- Danh sách lưu trữ hai người chơi gần nhất
  114.  
  115.  
  116. local function fly()
  117. sound:Play()
  118. local character = game.Players.LocalPlayer.Character
  119. if not character then return end
  120. local hrp = character:FindFirstChild("HumanoidRootPart")
  121. if not hrp then return end
  122. local humanoid = character:FindFirstChildWhichIsA("Humanoid")
  123. if not humanoid then return end
  124.  
  125. flying = true
  126. humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
  127.  
  128. local bv = Instance.new("BodyVelocity")
  129. local bg = Instance.new("BodyGyro")
  130. bv.MaxForce = Vector3.new(9e4, 9e4, 9e4)
  131. bg.CFrame = hrp.CFrame
  132. bg.MaxTorque = Vector3.new(9e4, 9e4, 9e4)
  133. bg.P = 9e4
  134. bv.Parent = hrp
  135. bg.Parent = hrp
  136.  
  137. local flycontrol = {F = 0, B = 0, L = 0, R = 0, U = 0, D = 0}
  138.  
  139. local uis = game:GetService("UserInputService")
  140. uis.InputBegan:Connect(function(key, processed)
  141. if processed then return end
  142. local keyName = key.KeyCode.Name:lower()
  143. if keyName == "w" then flycontrol.F = 1
  144. elseif keyName == "s" then flycontrol.B = 1
  145. elseif keyName == "a" then flycontrol.L = 1
  146. elseif keyName == "d" then flycontrol.R = 1
  147. elseif keyName == "space" then flycontrol.U = 1
  148. elseif keyName == "leftcontrol" then flycontrol.D = 1
  149. end
  150. end)
  151.  
  152. uis.InputEnded:Connect(function(key, processed)
  153. if processed then return end
  154. local keyName = key.KeyCode.Name:lower()
  155. if keyName == "w" then flycontrol.F = 0
  156. elseif keyName == "s" then flycontrol.B = 0
  157. elseif keyName == "a" then flycontrol.L = 0
  158. elseif keyName == "d" then flycontrol.R = 0
  159. elseif keyName == "space" then flycontrol.U = 0
  160. elseif keyName == "leftcontrol" then flycontrol.D = 0
  161. end
  162. end)
  163.  
  164. local con = game:GetService("RunService").Stepped:Connect(function()
  165. if not flying then
  166. con:Disconnect()
  167. bv:Destroy()
  168. bg:Destroy()
  169. end
  170. humanoid.PlatformStand = true
  171. bv.Velocity =
  172. (workspace.CurrentCamera.CFrame.LookVector * (flycontrol.F - flycontrol.B) * FlySpeed) +
  173. (workspace.CurrentCamera.CFrame.RightVector * (flycontrol.R - flycontrol.L) * FlySpeed) +
  174. (workspace.CurrentCamera.CFrame.UpVector * (flycontrol.U - flycontrol.D) * FlySpeed)
  175. bg.CFrame = workspace.CurrentCamera.CFrame
  176. end)
  177. game.StarterGui:SetCore("SendNotification", {
  178. Title = "FLy (ON)",
  179. Duration = 3,
  180. Text = "FLy Turn On!"
  181. })
  182. end
  183.  
  184. local function stopFlying()
  185. sound:Play()
  186. flying = false
  187. local character = game.Players.LocalPlayer.Character
  188. if character then
  189. local hrp = character:FindFirstChild("HumanoidRootPart")
  190. local humanoid = character:FindFirstChildWhichIsA("Humanoid")
  191. if hrp and humanoid then
  192. for _, obj in pairs(hrp:GetChildren()) do
  193. if obj:IsA("BodyVelocity") or obj:IsA("BodyGyro") then
  194. obj:Destroy()
  195. end
  196. end
  197. humanoid.PlatformStand = false
  198. humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true)
  199. end
  200. end
  201. game.StarterGui:SetCore("SendNotification", {
  202. Title = "FLy (OFF)",
  203. Duration = 3,
  204. Text = "FLy Turn OFF!"
  205. })
  206. end
  207.  
  208. local function setTransparency(character, transparency)
  209. for _, part in pairs(character:GetDescendants()) do
  210. if part:IsA("BasePart") or part:IsA("Decal") then
  211. part.Transparency = transparency
  212. end
  213. end
  214. end
  215.  
  216. local function toggleInvisibility()
  217. invis_on = not invis_on
  218. sound:Play()
  219. local player = game.Players.LocalPlayer
  220. local character = player.Character
  221.  
  222. if invis_on then
  223. local savedpos = character.HumanoidRootPart.CFrame
  224. wait()
  225. character:MoveTo(Vector3.new(-25.95, 84, 3537.55))
  226. wait(.15)
  227.  
  228. local Seat = Instance.new("Seat", game.Workspace)
  229. Seat.Anchored = false
  230. Seat.CanCollide = false
  231. Seat.Name = "invischair"
  232. Seat.Transparency = 1
  233. Seat.Position = Vector3.new(-25.95, 84, 3537.55)
  234.  
  235. local Weld = Instance.new("Weld", Seat)
  236. Weld.Part0 = Seat
  237. Weld.Part1 = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
  238.  
  239. wait()
  240. Seat.CFrame = savedpos
  241. setTransparency(character, 0.5)
  242.  
  243. game.StarterGui:SetCore("SendNotification", {
  244. Title = "Invisibility (ON)",
  245. Duration = 3,
  246. Text = "You have hidden!"
  247. })
  248. else
  249. local invisChair = workspace:FindFirstChild("invischair")
  250. if invisChair then
  251. invisChair:Destroy()
  252. end
  253.  
  254. setTransparency(character, 0)
  255. character.HumanoidRootPart.Transparency = 1
  256.  
  257. game.StarterGui:SetCore("SendNotification", {
  258. Title = "Invisibility (OFF)",
  259. Duration = 3,
  260. Text = "You are back to normal!"
  261. })
  262. end
  263. end
  264.  
  265. local modifiedParts = {} -- Danh sách lưu các khối đã bị chỉnh sửa
  266.  
  267. local function onTouch(part)
  268. if Noclip and part.CanCollide == true then
  269. part.CanCollide = false -- Biến đối tượng thành có thể đi xuyên qua
  270. table.insert(modifiedParts, part) -- Lưu lại khối đã bị chỉnh
  271. end
  272. end
  273.  
  274. local function toggleNoClip()
  275. Noclip = not Noclip -- Đảo trạng thái Noclip
  276. sound:Play()
  277. for _, v in pairs(player.Character:GetDescendants()) do
  278. if v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
  279. v.CanCollide = not Noclip -- Khi bật, tắt va chạm; Khi tắt, bật lại va chạm
  280.  
  281. if Noclip then
  282. v.Touched:Connect(onTouch) -- Kết nối sự kiện khi bật
  283. end
  284. end
  285. end
  286.  
  287. -- Khi tắt Noclip, khôi phục các khối đã bị chỉnh
  288. if not Noclip then
  289. for _, part in pairs(modifiedParts) do
  290. if part then
  291. part.CanCollide = true -- Đặt lại va chạm cho các khối đã bị chỉnh sửa
  292. end
  293. end
  294. modifiedParts = {} -- Xóa danh sách sau khi khôi phục
  295. end
  296.  
  297. game.StarterGui:SetCore("SendNotification", {
  298. Title = "Noclip",
  299. Duration = 3,
  300. Text = "Noclip is now - " .. tostring(Noclip)
  301. })
  302. end
  303.  
  304. local function infJump()
  305. sound:Play()
  306. game:GetService("UserInputService").JumpRequest:Connect(function()
  307. if InfiniteJumpEnabled then
  308. local humanoid = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  309. if humanoid then
  310. humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  311. end
  312. end
  313. end)
  314. game.StarterGui:SetCore("SendNotification", {
  315. Title = "InfJump",
  316. Duration = 3,
  317. Text = "InfJump is now - " .. tostring(InfiniteJumpEnabled)
  318. })
  319. end
  320.  
  321. -- Hàm kiểm tra input và đặt lại giá trị nếu trống
  322. local function handleKeybindInput(input, defaultValue)
  323. return (input and input ~= "") and input:upper() or defaultValue
  324. end
  325.  
  326. local function toggleFullBright()
  327. local lighting = game:GetService("Lighting")
  328. FullBrightEnabled = not FullBrightEnabled
  329.  
  330. if FullBrightEnabled then
  331. sound:Play()
  332. lighting.Ambient = Color3.fromRGB(255, 255, 255)
  333. lighting.Brightness = 1
  334. lighting.FogEnd = 1e10
  335.  
  336. -- Tắt các hiệu ứng làm mờ
  337. for _, v in pairs(lighting:GetDescendants()) do
  338. if v:IsA("BloomEffect") or v:IsA("BlurEffect") or v:IsA("ColorCorrectionEffect") or v:IsA("SunRaysEffect") then
  339. v.Enabled = false
  340. end
  341. end
  342.  
  343. -- Thêm ánh sáng vào nhân vật
  344. spawn(function()
  345. local player = game:GetService("Players").LocalPlayer
  346. local character = player.Character
  347. repeat wait() until character ~= nil
  348.  
  349. if not character.HumanoidRootPart:FindFirstChildWhichIsA("PointLight") then
  350. local headlight = Instance.new("PointLight", character.HumanoidRootPart)
  351. headlight.Brightness = 1
  352. headlight.Range = 60
  353. headlight.Name = "CustomLight"
  354. end
  355. end)
  356. else
  357. sound:Play()
  358. -- Khôi phục ánh sáng mặc định
  359. lighting.Ambient = originalAmbient
  360. lighting.Brightness = originalBrightness
  361. lighting.FogEnd = originalFogEnd
  362.  
  363. for _, v in pairs(lighting:GetDescendants()) do
  364. if v:IsA("BloomEffect") or v:IsA("BlurEffect") or v:IsA("ColorCorrectionEffect") or v:IsA("SunRaysEffect") then
  365. v.Enabled = true
  366. end
  367. end
  368.  
  369. -- Xóa ánh sáng nhân vật khi tắt
  370. local player = game:GetService("Players").LocalPlayer
  371. local character = player.Character
  372. if character and character.HumanoidRootPart then
  373. local headlight = character.HumanoidRootPart:FindFirstChild("CustomLight")
  374. if headlight then
  375. headlight:Destroy()
  376. end
  377. end
  378. end
  379. end
  380.  
  381. local function toggleKillbrick()
  382. nega = not nega
  383.  
  384. local player = game:GetService("Players").LocalPlayer
  385. local character = player.Character or player.CharacterAdded:Wait()
  386. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  387.  
  388. local parts = workspace:GetPartBoundsInRadius(humanoidRootPart.Position, 10)
  389. for _, part in ipairs(parts) do
  390. part.CanTouch = nega
  391. end
  392. end
  393.  
  394. ---------------------
  395. local FlyKeybind = "F" -- Phím mặc định
  396. local InvisKeybind = "G" -- Phím mặc định
  397. local NoclipKey = "X" -- Bạn có thể thay đổi phím tắt tại đây
  398. local InfJumpKey = "Z" -- Bạn có thể thay đổi phím tắt tại đây
  399.  
  400. local Tile1 = Tab1:CreateSection("Movement")
  401.  
  402. -- Tốc độ chạy
  403. local WalkSpeedSlider = Tab1:CreateSlider({
  404. Name = "Walk Speed",
  405. Range = {16, 300},
  406. Increment = 5,
  407. CurrentValue = Humanoid.WalkSpeed,
  408. Callback = function(Value)
  409. Humanoid.WalkSpeed = Value
  410. end
  411. })
  412.  
  413. -- **Chỉnh độ cao khi nhảy**
  414. local JumpSlider = Tab1:CreateSlider({
  415. Name = "Jump height",
  416. Range = {7.2, 1000},
  417. Increment = 20,
  418. CurrentValue = 50,
  419. Callback = function(Value)
  420. game.Players.LocalPlayer.Character.Humanoid.UseJumpPower = false
  421. game.Players.LocalPlayer.Character.Humanoid.JumpHeight = Value
  422. end
  423. })
  424.  
  425. -- **Chỉnh tốc độ bay**
  426. local FlySpeedSlider = Tab1:CreateSlider({
  427. Name = "Flight speed",
  428. Range = {50, 1000},
  429. Default = FlySpeed, -- Giá trị mặc định
  430. Increment = 10,
  431. CurrentValue = FlySpeed,
  432. Callback = function(Value)
  433. FlySpeed = Value
  434. end
  435. })
  436.  
  437. local FlyButton = Tab1:CreateButton({
  438. Name = "Fly",
  439. Callback = function()
  440. if flying then
  441. stopFlying()
  442. else
  443. fly()
  444. end
  445. end
  446. })
  447.  
  448. -- Nút bật/tắt teleport
  449. local TeleportButton = Tab1:CreateButton({
  450. Name = "CLick Teleport",
  451. Callback = function()
  452. TeleportEnabled = not TeleportEnabled
  453. sound:Play()
  454. Rayfield:Notify({
  455. Title = "Notification",
  456. Content = TeleportEnabled and "Teleport is on!" or "Teleport is off!",
  457. Duration = 2.5
  458. })
  459. end
  460. })
  461.  
  462. local InfJumpButton = Tab1:CreateButton({
  463. Name = "Infinite Jump",
  464. Callback = function()
  465. InfiniteJumpEnabled = not InfiniteJumpEnabled
  466. if InfiniteJumpEnabled then
  467. infJump()
  468. end
  469. end
  470. })
  471.  
  472.  
  473. local Tile2 = Tab1:CreateSection("Players")
  474. -- Thêm nút bật/tắt ẩn thân vào menu Rayfield
  475. local InvisButton = Tab1:CreateButton({
  476. Name = "Invisible",
  477. Callback = function()
  478. toggleInvisibility()
  479. end,
  480. })
  481.  
  482. local NoclipButton = Tab1:CreateButton({
  483. Name = "Noclip",
  484. Callback = function()
  485. toggleNoClip()
  486. end,
  487. })
  488. -- Tạo nút bật/tắt Full Bright
  489. local FullBrightButton = Tab1:CreateButton({
  490. Name = "Full Bright",
  491. Callback = function()
  492. toggleFullBright()
  493. end,
  494. })
  495.  
  496. Tab1:CreateButton({
  497. Name = "Killbrick Toggle",
  498. Callback = function()
  499. toggleKillbrick()
  500. if nega then
  501. sound:Play()
  502. Rayfield:Notify({
  503. Title = "Killbrick",
  504. Content = "Killbrick is now OFF",
  505. Duration = 2
  506. })
  507. else
  508. sound:Play()
  509. Rayfield:Notify({
  510. Title = "Killbrick",
  511. Content = "Killbrick is now ON",
  512. Duration = 2
  513. })
  514. end
  515. end
  516. })
  517.  
  518.  
  519. local Tile3 = Tab1:CreateSection("OtherPlayers")
  520. --! Tạo textbox nhập tên người chơi
  521. local PlayerTextbox = Tab1:CreateInput({
  522. Name = "Enter player name or nickname",
  523. PlaceholderText = "Enter a partial player name",
  524. Callback = function(input)
  525. SelectedPlayer = nil
  526. for _, p in ipairs(game.Players:GetPlayers()) do
  527. if string.find(string.lower(p.Name), string.lower(input)) then
  528. SelectedPlayer = p
  529. print("You have entered: " .. input .. " - Find: " .. p.Name)
  530. break
  531. end
  532. end
  533. end
  534. })
  535.  
  536.  
  537. local RandomPlayerButton = Tab1:CreateButton({
  538. Name = "Randomly Select Players",
  539. Callback = function()
  540. local players = game.Players:GetPlayers()
  541. local localPlayer = game.Players.LocalPlayer
  542.  
  543. -- Loại bỏ người chơi chính mình khỏi danh sách
  544. for i = #players, 1, -1 do
  545. if players[i] == localPlayer then
  546. table.remove(players, i)
  547. break
  548. end
  549. end
  550.  
  551. -- Loại bỏ hai người chơi gần nhất từ danh sách
  552. for _, lastPlayer in ipairs(lastSelectedPlayers) do
  553. for i = #players, 1, -1 do
  554. if players[i] == lastPlayer then
  555. table.remove(players, i)
  556. break
  557. end
  558. end
  559. end
  560.  
  561. if #players > 0 then
  562. sound:Play()
  563. SelectedPlayer = players[math.random(1, #players)]
  564. PlayerTextbox.Text = SelectedPlayer.Name -- Cập nhật tên vào textbox
  565.  
  566. -- Lấy URL ảnh đại diện của người chơi
  567. local avatarUrl = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. SelectedPlayer.UserId .. "&width=150&height=150&format=png"
  568.  
  569. -- Hiển thị thông báo với avatar
  570. game.StarterGui:SetCore("SendNotification", {
  571. Title = "The player is chosen",
  572. Text = SelectedPlayer.Name,
  573. Duration = 4,
  574. Icon = avatarUrl -- Hiển thị avatar
  575. })
  576.  
  577. print("Randomly selected player: " .. SelectedPlayer.Name)
  578.  
  579. -- Cập nhật danh sách người chơi đã chọn gần nhất
  580. table.insert(lastSelectedPlayers, SelectedPlayer)
  581. if #lastSelectedPlayers > 2 then
  582. table.remove(lastSelectedPlayers, 1) -- Đảm bảo danh sách chỉ chứa hai người chơi gần nhất
  583. end
  584. else
  585. sound:Play()
  586. game.StarterGui:SetCore("SendNotification", {
  587. Title = "Server",
  588. Text = "No One Found",
  589. Duration = 4,
  590. })
  591. print("No players found in server!")
  592. end
  593. end
  594. })
  595.  
  596.  
  597. --! Nút teleport đến người chơi đã nhập
  598. local TeleportToPlayer = Tab1:CreateButton({
  599. Name = "Teleport to player",
  600. Callback = function()
  601. if SelectedPlayer and SelectedPlayer.Character and SelectedPlayer.Character:FindFirstChild("HumanoidRootPart") then
  602. sound:Play()
  603. player.Character.HumanoidRootPart.CFrame = SelectedPlayer.Character.HumanoidRootPart.CFrame
  604. print("Teleported to player: " .. SelectedPlayer.Name)
  605. else
  606. sound:Play()
  607. print("Cannot teleport! Check player name.")
  608. end
  609. end
  610. })
  611.  
  612. --! Nút bật/tắt theo dõi
  613. local FollowPlayer = Tab1:CreateButton({
  614. Name = "Enable/Disable Tracking",
  615. Callback = function()
  616. following = not following -- Đảo trạng thái theo dõi
  617.  
  618. if following then
  619. sound:Play()
  620. if SelectedPlayer and SelectedPlayer.Character and SelectedPlayer.Character:FindFirstChild("HumanoidRootPart") then
  621. spawn(function()
  622. while following do
  623. if not SelectedPlayer or not SelectedPlayer.Character or not SelectedPlayer.Character:FindFirstChild("HumanoidRootPart") then
  624. following = false
  625. break
  626. end
  627.  
  628. -- Lấy vị trí của người chơi mục tiêu
  629. local targetPosition = SelectedPlayer.Character.HumanoidRootPart.Position
  630.  
  631. -- Điều chỉnh vị trí gần hơn phía sau lưng và lơ lửng
  632. local offset = Vector3.new(0, 5, -1) -- Giữ khoảng cách phía sau chỉ 1 đơn vị
  633. local newPosition = targetPosition + SelectedPlayer.Character.HumanoidRootPart.CFrame.LookVector * offset.Z + Vector3.new(0, offset.Y, 0)
  634.  
  635. -- Dịch chuyển người chơi theo vị trí mới
  636. player.Character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  637.  
  638. task.wait()
  639. end
  640. end)
  641. else
  642. end
  643. else
  644. sound:Play()
  645. end
  646. end
  647. })
  648.  
  649. --! Nút chuyển góc nhìn
  650. local ViewPlayerButton = Tab1:CreateButton({
  651. Name = "Change Perspective",
  652. Callback = function()
  653. local camera = game.Workspace.CurrentCamera
  654. if viewingPlayer then
  655. sound:Play()
  656. -- Trở về góc nhìn ban đầu
  657. camera.CameraSubject = originalCameraSubject
  658. viewingPlayer = false
  659. else
  660. sound:Play()
  661. -- Chuyển góc nhìn sang người chơi đã nhập
  662. if SelectedPlayer and SelectedPlayer.Character and SelectedPlayer.Character:FindFirstChildWhichIsA("Humanoid") then
  663. camera.CameraSubject = SelectedPlayer.Character:FindFirstChildWhichIsA("Humanoid")
  664. viewingPlayer = true
  665. else
  666. end
  667. end
  668. end
  669. })
  670.  
  671.  
  672. local Tile4 = Tab1:CreateSection("SettingKey")
  673. -- Fly --
  674. local KeybindInput = Tab1:CreateInput({
  675. Name = "Fly On/Off Key",
  676. PlaceholderText = FlyKeybind,
  677. RemoveTextAfterFocusLost = false,
  678. Flag = "Fly_Key",
  679. Callback = function(input)
  680. FlyKeybind = handleKeybindInput(input, "F") -- Sử dụng giá trị mặc định nếu input rỗng
  681. end
  682. })
  683.  
  684. -- Invisible --
  685. local KeybindInput2 = Tab1:CreateInput({
  686. Name = "Invisible on/off key",
  687. PlaceholderText = InvisKeybind,
  688. RemoveTextAfterFocusLost = false,
  689. Flag = "Invisible_Key",
  690. Callback = function(input)
  691. InvisKeybind = handleKeybindInput(input, "G")
  692. end
  693. })
  694.  
  695. -- Noclip --
  696. local KeybindInput3 = Tab1:CreateInput({
  697. Name = "Noclip on/off key",
  698. PlaceholderText = NoclipKey,
  699. RemoveTextAfterFocusLost = false,
  700. Flag = "Noclip_Key",
  701. Callback = function(input)
  702. NoclipKey = handleKeybindInput(input, "X")
  703. end
  704. })
  705.  
  706. -- InfJump --
  707. local KeybindInput4 = Tab1:CreateInput({
  708. Name = "InfJump on/off key",
  709. PlaceholderText = InfJumpKey,
  710. RemoveTextAfterFocusLost = false,
  711. Flag = "InfJump_Key",
  712. Callback = function(input)
  713. InfJumpKey = handleKeybindInput(input, "Z")
  714. end
  715. })
  716.  
  717. ----------------------------
  718. game:GetService("UserInputService").InputBegan:Connect(function(key, processed)
  719. if processed then return end
  720. local keyName = key.KeyCode.Name:upper()
  721.  
  722. if keyName == FlyKeybind then
  723. if flying then stopFlying() else fly() end
  724. elseif keyName == InvisKeybind then
  725. toggleInvisibility()
  726. elseif keyName == NoclipKey then
  727. toggleNoClip()
  728. elseif keyName == InfJumpKey then
  729. infJump()
  730. end
  731. end)
  732.  
  733. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  734.  
  735. if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessed and TeleportEnabled then
  736. local player = game.Players.LocalPlayer
  737. if player and player.Character and player.Character.PrimaryPart then
  738. local mouse = player:GetMouse()
  739. player.Character:SetPrimaryPartCFrame(CFrame.new(mouse.Hit.p))
  740. end
  741. end
  742. end)
  743.  
  744.  
  745.  
  746. ------------------------------------------------------
  747. ----------TAB 2 _____________________________________-
  748.  
  749. local HttpService = game:GetService("HttpService")
  750. local RunService = game:GetService("RunService")
  751. local TeleportService = game:GetService("TeleportService")
  752. local players = game:GetService("Players")
  753. local wrk = game:GetService("Workspace")
  754. local plr = players.LocalPlayer
  755. local hrp = plr.Character:FindFirstChild("HumanoidRootPart")
  756. local humanoid = plr.Character:FindFirstChild("Humanoid")
  757.  
  758. local function onCharacterAdded(character)
  759. hrp = character:WaitForChild("HumanoidRootPart")
  760. humanoid = character:WaitForChild("Humanoid")
  761. end
  762.  
  763. plr.CharacterAdded:Connect(onCharacterAdded)
  764.  
  765. if plr.Character then
  766. onCharacterAdded(plr.Character)
  767. end
  768.  
  769. local camera = wrk.CurrentCamera
  770. local mouse = plr:GetMouse()
  771.  
  772. local httprequest = (syn and syn.request) or (http and http.request) or http_request or (fluxus and fluxus.request) or request
  773.  
  774. local hue = 0
  775. local rainbowFov = true
  776. local rainbowSpeed = 0.005
  777.  
  778. local aimFov = 100
  779. local aimParts = {"Head"}
  780. local aiming = false
  781. local predictionStrength = 0
  782. local smoothing = 0
  783.  
  784. local aimbotEnabled = false
  785. local wallCheck = false
  786. local stickyAimEnabled = false
  787. local teamCheck = false
  788. local healthCheck = false
  789. local minHealth = 0
  790.  
  791. local antiAim = false
  792.  
  793. local antiAimAmountX = 0
  794. local antiAimAmountY = -100
  795. local antiAimAmountZ = 0
  796.  
  797. local antiAimMethod = "Reset Velo"
  798.  
  799. local randomVeloRange = 100
  800.  
  801. local spinBot = false
  802. local spinBotSpeed = 20
  803.  
  804. local circleColor = Color3.fromRGB(255, 0, 0)
  805. local targetedCircleColor = Color3.fromRGB(0, 255, 0)
  806.  
  807. local aimViewerEnabled = false
  808. local ignoreSelf = true
  809.  
  810. local fovCircle = Drawing.new("Circle")
  811. fovCircle.Thickness = 2
  812. fovCircle.Radius = aimFov
  813. fovCircle.Filled = false
  814. fovCircle.Color = circleColor
  815. fovCircle.Visible = false
  816.  
  817. local currentTarget = nil
  818.  
  819. local function checkTeam(player)
  820. if teamCheck and player.Team == plr.Team then
  821. return true
  822. end
  823. return false
  824. end
  825.  
  826. local function checkWall(targetCharacter)
  827. local targetHead = targetCharacter:FindFirstChild("Head")
  828. if not targetHead then return true end
  829.  
  830. local origin = camera.CFrame.Position
  831. local direction = (targetHead.Position - origin).unit * (targetHead.Position - origin).magnitude
  832. local raycastParams = RaycastParams.new()
  833. raycastParams.FilterDescendantsInstances = {plr.Character, targetCharacter}
  834. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  835.  
  836. local raycastResult = wrk:Raycast(origin, direction, raycastParams)
  837. return raycastResult and raycastResult.Instance ~= nil
  838. end
  839.  
  840. local function getClosestPart(character)
  841. local closestPart = nil
  842. local shortestCursorDistance = aimFov * 0.8 -- Giảm phạm vi ngắm để tăng độ chính xác
  843. local cameraPos = camera.CFrame.Position
  844.  
  845. for _, partName in ipairs(aimParts) do
  846. local part = character:FindFirstChild(partName)
  847. if part then
  848. local partPos = camera:WorldToViewportPoint(part.Position)
  849. local screenPos = Vector2.new(partPos.X, partPos.Y)
  850. local cursorDistance = (screenPos - Vector2.new(mouse.X, mouse.Y)).Magnitude
  851.  
  852. if cursorDistance < shortestCursorDistance and partPos.Z > 0 then
  853. shortestCursorDistance = cursorDistance
  854. closestPart = part
  855. end
  856. end
  857. end
  858.  
  859. return closestPart
  860. end
  861.  
  862. local function getTarget()
  863. local nearestPlayer = nil
  864. local closestPart = nil
  865. local shortestCursorDistance = aimFov * 0.75 -- Tăng độ chính xác bằng cách giảm phạm vi tìm kiếm
  866.  
  867. for _, player in ipairs(players:GetPlayers()) do
  868. if player ~= plr and player.Character and not checkTeam(player) then
  869. if player.Character.Humanoid.Health >= minHealth or not healthCheck then
  870. local targetPart = getClosestPart(player.Character)
  871. if targetPart then
  872. local screenPos = camera:WorldToViewportPoint(targetPart.Position)
  873. local cursorDistance = (Vector2.new(screenPos.X, screenPos.Y) - Vector2.new(mouse.X, mouse.Y)).Magnitude
  874.  
  875. if cursorDistance < shortestCursorDistance then
  876. if not wallCheck or not checkWall(player.Character) then
  877. shortestCursorDistance = cursorDistance
  878. nearestPlayer = player
  879. closestPart = targetPart
  880. end
  881. end
  882. end
  883. end
  884. end
  885. end
  886.  
  887. return nearestPlayer, closestPart
  888. end
  889.  
  890.  
  891. local function predict(player, part)
  892. if player and part then
  893. local velocity = player.Character.HumanoidRootPart.Velocity
  894. local predictedPosition = part.Position + (velocity * predictionStrength) * 0.5 -- Giảm sức mạnh dự đoán
  895. return predictedPosition
  896. end
  897. return nil
  898. end
  899.  
  900. local function smooth(from, to)
  901. return from:Lerp(to, smoothing * 0.8) -- Tăng độ bám sát mục tiêu
  902. end
  903.  
  904. local function aimAt(player, part)
  905. local predictedPosition = predict(player, part)
  906. if predictedPosition then
  907. if player.Character.Humanoid.Health >= minHealth or not healthCheck then
  908. camera.CFrame = CFrame.new(camera.CFrame.Position, predictedPosition)
  909. end
  910. end
  911. end
  912.  
  913.  
  914.  
  915.  
  916. RunService.RenderStepped:Connect(function()
  917. if aimbotEnabled then
  918. local offset = 50
  919. fovCircle.Position = Vector2.new(mouse.X, mouse.Y + offset)
  920.  
  921. if rainbowFov then
  922. hue = hue + rainbowSpeed
  923. if hue > 1 then hue = 0 end
  924. fovCircle.Color = Color3.fromHSV(hue, 1, 1)
  925. else
  926. if aiming and currentTarget then
  927. fovCircle.Color = targetedCircleColor
  928. else
  929. fovCircle.Color = circleColor
  930. end
  931. end
  932.  
  933. if aiming then
  934. if stickyAimEnabled and currentTarget then
  935. local headPos = camera:WorldToViewportPoint(currentTarget.Character.Head.Position)
  936. local screenPos = Vector2.new(headPos.X, headPos.Y)
  937. local cursorDistance = (screenPos - Vector2.new(mouse.X, mouse.Y)).Magnitude
  938.  
  939. if cursorDistance > aimFov or (wallCheck and checkWall(currentTarget.Character)) or checkTeam(currentTarget) then
  940. currentTarget = nil
  941. end
  942. end
  943.  
  944. if not stickyAimEnabled or not currentTarget then
  945. local target, targetPart = getTarget()
  946. currentTarget = target
  947. currentTargetPart = targetPart
  948. end
  949.  
  950. if currentTarget and currentTargetPart then
  951. aimAt(currentTarget, currentTargetPart)
  952. end
  953. else
  954. currentTarget = nil
  955. end
  956. end
  957. end)
  958.  
  959. RunService.Heartbeat:Connect(function()
  960. if antiAim then
  961. if antiAimMethod == "Reset Velo" then
  962. local vel = hrp.Velocity
  963. hrp.Velocity = Vector3.new(antiAimAmountX, antiAimAmountY, antiAimAmountZ)
  964. RunService.RenderStepped:Wait()
  965. hrp.Velocity = vel
  966. elseif antiAimMethod == "Reset Pos [BROKEN]" then
  967. local pos = hrp.CFrame
  968. hrp.Velocity = Vector3.new(antiAimAmountX, antiAimAmountY, antiAimAmountZ)
  969. RunService.RenderStepped:Wait()
  970. hrp.CFrame = pos
  971. elseif antiAimMethod == "Random Velo" then
  972. local vel = hrp.Velocity
  973. local a = math.random(-randomVeloRange,randomVeloRange)
  974. local s = math.random(-randomVeloRange,randomVeloRange)
  975. local d = math.random(-randomVeloRange,randomVeloRange)
  976. hrp.Velocity = Vector3.new(a,s,d)
  977. RunService.RenderStepped:Wait()
  978. hrp.Velocity = vel
  979. end
  980. end
  981. end)
  982.  
  983. mouse.Button2Down:Connect(function()
  984. if aimbotEnabled then
  985. aiming = true
  986. end
  987. end)
  988.  
  989. mouse.Button2Up:Connect(function()
  990. if aimbotEnabled then
  991. aiming = false
  992. end
  993. end)
  994.  
  995. local Tile1 = Tab2:CreateSection("Aimbot")
  996.  
  997. local aimbot = Tab2:CreateToggle({
  998. Name = "Aimbot",
  999. CurrentValue = false,
  1000. Flag = "Aimbot",
  1001. Callback = function(Value)
  1002. sound:Play()
  1003. aimbotEnabled = Value
  1004. fovCircle.Visible = Value
  1005. end
  1006. })
  1007.  
  1008. local aimpart = Tab2:CreateDropdown({
  1009. Name = "Aim Part",
  1010. Options = {"Head","HumanoidRootPart","Left Arm","Right Arm","Torso","Left Leg","Right Leg"},
  1011. CurrentOption = {"Head"},
  1012. MultipleOptions = true,
  1013. Flag = "AimPart",
  1014. Callback = function(Options)
  1015. aimParts = Options
  1016. end,
  1017. })
  1018.  
  1019.  
  1020. local fovvisibility = Tab2:CreateToggle({
  1021. Name = "Fov Visibility",
  1022. CurrentValue = true,
  1023. Flag = "FovVisibility",
  1024. Callback = function(Value)
  1025. sound:Play()
  1026. fovCircle.Visible = Value
  1027. end
  1028. })
  1029.  
  1030. local aimbotfov = Tab2:CreateSlider({
  1031. Name = "Aimbot Fov",
  1032. Range = {0, 1000},
  1033. Increment = 1,
  1034. CurrentValue = 100,
  1035. Flag = "AimbotFov",
  1036. Callback = function(Value)
  1037. aimFov = Value
  1038. fovCircle.Radius = aimFov
  1039. end,
  1040. })
  1041.  
  1042. local Tile2 = Tab2:CreateSection("Setting")
  1043.  
  1044. local wallcheck = Tab2:CreateToggle({
  1045. Name = "Wall Check",
  1046. CurrentValue = false,
  1047. Flag = "WallCheck",
  1048. Callback = function(Value)
  1049. sound:Play()
  1050. wallCheck = Value
  1051. end
  1052. })
  1053.  
  1054. local stickyaim = Tab2:CreateToggle({
  1055. Name = "Sticky Aim",
  1056. CurrentValue = false,
  1057. Flag = "StickyAim",
  1058. Callback = function(Value)
  1059. sound:Play()
  1060. stickyAimEnabled = Value
  1061. end
  1062. })
  1063.  
  1064. local teamchecktoggle = Tab2:CreateToggle({
  1065. Name = "Team Check",
  1066. CurrentValue = false,
  1067. Flag = "TeamCheck",
  1068. Callback = function(Value)
  1069. sound:Play()
  1070. teamCheck = Value
  1071. end
  1072. })
  1073.  
  1074. local healthchecktoggle = Tab2:CreateToggle({
  1075. Name = "Health Check",
  1076. CurrentValue = false,
  1077. Flag = "HealthCheck",
  1078. Callback = function(Value)
  1079. sound:Play()
  1080. healthCheck = Value
  1081. end
  1082. })
  1083.  
  1084. local minhealth = Tab2:CreateSlider({
  1085. Name = "Min Health",
  1086. Range = {0, 100},
  1087. Increment = 1,
  1088. CurrentValue = 0,
  1089. Flag = "MinHealth",
  1090. Callback = function(Value)
  1091. minHealth = Value
  1092. end,
  1093. })
  1094.  
  1095. local circlecolor = Tab2:CreateColorPicker({
  1096. Name = "Fov Color",
  1097. Color = circleColor,
  1098. Callback = function(Color)
  1099. circleColor = Color
  1100. fovCircle.Color = Color
  1101. end
  1102. })
  1103.  
  1104. local targetedcirclecolor = Tab2:CreateColorPicker({
  1105. Name = "Targeted Fov Color",
  1106. Color = targetedCircleColor,
  1107. Callback = function(Color)
  1108. targetedCircleColor = Color
  1109. end
  1110. })
  1111.  
  1112. local circlerainbow = Tab2:CreateToggle({
  1113. Name = "Rainbow Fov",
  1114. CurrentValue = true,
  1115. Flag = "RainbowFov",
  1116. Callback = function(Value)
  1117. sound:Play()
  1118. rainbowFov = Value
  1119. end
  1120. })
  1121.  
  1122. ------------------------------------------------------
  1123. --------ESP------------------------------------------
  1124.  
  1125. local RunService = game:GetService("RunService")
  1126. local Players = game:GetService("Players")
  1127. local camera = workspace.CurrentCamera
  1128. local lplr = Players.LocalPlayer
  1129.  
  1130. -- Biến toàn cục về ESP
  1131. local nameEspEnabled = false
  1132. _G.TeamCheck = false
  1133. _G.ESPEnabled = false
  1134. _G.TeamCheckTracer = false
  1135. _G.TracerColor = Color3.new(1, 1, 1)
  1136. _G.RainbowEnabled = false
  1137. _G.BoxESPEnabled = false
  1138. _G.NameESPEnabled = false
  1139. _G.NameESPFont = 12
  1140.  
  1141. -- Biến Box ESP
  1142. local BoxEnabled = false
  1143. local RainbowEnabled = false
  1144. local BoxStroke = 2
  1145. local BoxObjects = {}
  1146. local BoxConfig = { BoxTransparency = 0.5, MaxDistance = 5000 }
  1147.  
  1148. -- Biến Tracer & Name ESP
  1149. local tracers = {}
  1150. local nameTags = {}
  1151.  
  1152.  
  1153.  
  1154. local function createTracer(player)
  1155. if tracers[player] or player == lplr then return end -- Không liên kết chính mình
  1156. local tracer = Drawing.new("Line")
  1157. tracer.Thickness = 1
  1158. tracer.Color = _G.TracerColor or Color3.fromRGB(255, 0, 0)
  1159. tracer.Visible = false
  1160. tracers[player] = tracer
  1161. end
  1162.  
  1163. local function getRainbowColor()
  1164. local hue = (tick() % 5) / 5
  1165. return Color3.fromHSV(hue, 1, 1)
  1166. end
  1167.  
  1168.  
  1169. local function updateTracers()
  1170. for player, tracer in pairs(tracers) do
  1171. if _G.ESPEnabled and player.Character and player.Character:FindFirstChild("HumanoidRootPart") and player.Character.Humanoid.Health > 0 then
  1172. -- Kiểm tra nếu team check bật và người chơi cùng đội
  1173. if _G.TeamCheckTracer and player.Team == lplr.Team then
  1174. tracer.Visible = false -- Ẩn tracer nếu cùng đội
  1175. else
  1176. local screenPos, onScreen = camera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
  1177. if onScreen then
  1178. tracer.From = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y - 50)
  1179. tracer.To = Vector2.new(screenPos.X, screenPos.Y)
  1180. tracer.Visible = true
  1181.  
  1182. -- Kiểm tra nếu chế độ Rainbow đang bật
  1183. if _G.RainbowEnabled then
  1184. tracer.Color = getRainbowColor()
  1185. else
  1186. tracer.Color = _G.TracerColor
  1187. end
  1188. else
  1189. tracer.Visible = false
  1190. end
  1191. end
  1192. else
  1193. tracer.Visible = false
  1194. end
  1195. end
  1196. end
  1197.  
  1198.  
  1199.  
  1200. local function createNameTag(player)
  1201. if nameTags[player] or player == lplr then return end -- Không hiển thị tên chính mình
  1202. local nameTag = Drawing.new("Text")
  1203. nameTag.Text = player.Name
  1204. nameTag.Size = _G.NameESPFont or 12
  1205. nameTag.Color = Color3.fromRGB(255, 255, 255) -- Màu mặc định là trắng
  1206. nameTag.Center = true
  1207. nameTag.Visible = false
  1208. nameTags[player] = nameTag
  1209. end
  1210.  
  1211. local function updateNameTags()
  1212. for player, nameTag in pairs(nameTags) do
  1213. if nameEspEnabled and player.Character and player.Character:FindFirstChild("Head") then
  1214. local screenPos, onScreen = camera:WorldToViewportPoint(player.Character.Head.Position)
  1215. if onScreen then
  1216. nameTag.Position = Vector2.new(screenPos.X, screenPos.Y - 20) -- Để tên ở trên đầu
  1217. nameTag.Visible = true
  1218. nameTag.Color = _G.RainbowEnabled and getRainbowColor() or Color3.fromRGB(255, 255, 255) -- Rainbow màu nếu bật
  1219. else
  1220. nameTag.Visible = false
  1221. end
  1222. else
  1223. nameTag.Visible = false
  1224. end
  1225. end
  1226. end
  1227.  
  1228.  
  1229. local function toggleNameESP(state)
  1230. nameEspEnabled = state
  1231. if state then
  1232. sound:Play()
  1233. for _, player in pairs(Players:GetPlayers()) do
  1234. createNameTag(player)
  1235. end
  1236. else
  1237. sound:Play()
  1238. for _, nameTag in pairs(nameTags) do
  1239. nameTag.Visible = false
  1240. end
  1241. end
  1242. end
  1243.  
  1244. --Hàm bật/tắt Box
  1245. local function ToggleBox(state)
  1246. sound:Play()
  1247. BoxEnabled = state
  1248.  
  1249. if not BoxEnabled then
  1250. for _, boxObject in pairs(BoxObjects) do
  1251. boxObject.Box.Visible = false
  1252. end
  1253. end
  1254. end
  1255.  
  1256. -- Hàm cập nhật độ dày viền
  1257. local function UpdateStroke(value)
  1258. BoxStroke = tonumber(value) or 2 -- Đảm bảo giá trị hợp lệ
  1259. for _, boxObject in pairs(BoxObjects) do
  1260. boxObject.Box.Thickness = BoxStroke
  1261. end
  1262. end
  1263.  
  1264. -- Hàm tạo Box cho người chơi
  1265. local function CreateBoxForPlayer(player)
  1266. if player == LocalPlayer then return end
  1267.  
  1268. local boxObject = {
  1269. Box = Drawing.new("Square"),
  1270. }
  1271.  
  1272. -- Thiết lập Box
  1273. boxObject.Box.Visible = false
  1274. boxObject.Box.Thickness = BoxStroke
  1275. boxObject.Box.Transparency = BoxConfig.BoxTransparency
  1276. boxObject.Box.Filled = false
  1277. boxObject.Box.Color = Color3.fromRGB(255, 255, 255) -- Mặc định là màu trắng
  1278.  
  1279. BoxObjects[player] = boxObject
  1280.  
  1281. player.AncestryChanged:Connect(function()
  1282. if not player:IsDescendantOf(game) then
  1283. boxObject.Box:Remove()
  1284. BoxObjects[player] = nil
  1285. end
  1286. end)
  1287. end
  1288.  
  1289. -- Thêm Box cho tất cả người chơi hiện tại
  1290. for _, player in pairs(Players:GetPlayers()) do
  1291. if player ~= LocalPlayer then
  1292. CreateBoxForPlayer(player)
  1293. end
  1294. end
  1295.  
  1296.  
  1297. RunService.RenderStepped:Connect(function()
  1298. if not BoxEnabled then return end
  1299.  
  1300. for player, boxObject in pairs(BoxObjects) do
  1301. local character = player.Character
  1302. if not character or not character:FindFirstChild("HumanoidRootPart") then
  1303. boxObject.Box.Visible = false
  1304. continue
  1305. end
  1306.  
  1307. -- 🔥 Kiểm tra Team Check (Nếu bật thì Box không hiển thị trên đồng đội)
  1308. if _G.TeamCheck then
  1309. if player.Team == lplr.Team then
  1310. boxObject.Box.Visible = false
  1311. continue
  1312. end
  1313. end
  1314.  
  1315. -- 🔥 Kiểm tra nếu người chơi là chính bạn
  1316. if player == lplr then
  1317. boxObject.Box.Visible = false
  1318. continue
  1319. end
  1320.  
  1321. local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
  1322. local vector, onScreen = camera:WorldToViewportPoint(humanoidRootPart.Position)
  1323. local distance = (humanoidRootPart.Position - camera.CFrame.Position).Magnitude
  1324.  
  1325. if onScreen and distance <= BoxConfig.MaxDistance then
  1326. local topPosition = humanoidRootPart.Position + Vector3.new(0, 3, 0)
  1327. local bottomPosition = humanoidRootPart.Position - Vector3.new(0, 3, 0)
  1328.  
  1329. local topVector = camera:WorldToViewportPoint(topPosition)
  1330. local bottomVector = camera:WorldToViewportPoint(bottomPosition)
  1331.  
  1332. local height = math.abs(topVector.Y - bottomVector.Y)
  1333. local width = height * 0.6
  1334.  
  1335. local boxPosition = Vector2.new(vector.X - width / 2, vector.Y - height / 2)
  1336. local boxSize = Vector2.new(width, height)
  1337.  
  1338. -- Cập nhật Box
  1339. boxObject.Box.Position = boxPosition
  1340. boxObject.Box.Size = boxSize
  1341. boxObject.Box.Visible = true
  1342. boxObject.Box.Thickness = BoxStroke
  1343.  
  1344. -- Cập nhật màu Rainbow nếu bật
  1345. boxObject.Box.Color = RainbowEnabled and getRainbowColor() or Color3.fromRGB(255, 255, 255)
  1346. else
  1347. boxObject.Box.Visible = false
  1348. end
  1349. end
  1350. end)
  1351.  
  1352.  
  1353.  
  1354. local function toggleESPTracer(state)
  1355. _G.ESPEnabled = state
  1356. if state then
  1357. sound:Play()
  1358. for _, player in pairs(Players:GetPlayers()) do
  1359. createTracer(player)
  1360. end
  1361. else
  1362. sound:Play()
  1363. for _, tracer in pairs(tracers) do
  1364. tracer.Visible = false
  1365. end
  1366. end
  1367. end
  1368.  
  1369.  
  1370. Players.PlayerAdded:Connect(createTracer)
  1371. Players.PlayerAdded:Connect(CreateBoxForPlayer)
  1372. Players.PlayerAdded:Connect(createNameTag)
  1373. Players.PlayerRemoving:Connect(function(player)
  1374. if tracers[player] then
  1375. tracers[player]:Remove()
  1376. tracers[player] = nil
  1377. end
  1378. if nameTags[player] then
  1379. nameTags[player]:Remove()
  1380. nameTags[player] = nil
  1381. end
  1382. end)
  1383. RunService.RenderStepped:Connect(updateTracers)
  1384. RunService.RenderStepped:Connect(updateNameTags)
  1385.  
  1386. local Tile1 = Tab3:CreateSection("ESP")
  1387. -- Nút bật/tắt ESP Tracer
  1388. local espToggle = Tab3:CreateToggle({
  1389. Name = "ESP Tracer",
  1390. Default = false,
  1391. Flag = "Tracer",
  1392. Callback = function(Value)
  1393. toggleESPTracer(Value)
  1394. end
  1395. })
  1396.  
  1397. -- Tạo tab UI cho Box
  1398. Tab3:CreateToggle({
  1399. Name = "Turn Box On/Off",
  1400. Default = false,
  1401. Flag = "Box",
  1402. Callback = function(Value)
  1403. ToggleBox(Value)
  1404. end
  1405. })
  1406.  
  1407. -- Thêm nút bật/tắt ESP Name
  1408. local nameEspToggle = Tab3:CreateToggle({
  1409. Name = "ESP Name",
  1410. Default = false,
  1411. Flag = "Name",
  1412. Callback = function(Value)
  1413. toggleNameESP(Value)
  1414. end
  1415. })
  1416.  
  1417. -- Thêm Toggle bật/tắt chế độ Rainbow
  1418. local RainbowEsp = Tab3:CreateToggle({
  1419. Name = "Turn Rainbow mode on/off",
  1420. Default = false,
  1421. Flag = "RainbowESP",
  1422. Callback = function(Value)
  1423. sound:Play()
  1424. _G.RainbowEnabled = Value
  1425. RainbowEnabled = Value
  1426. end
  1427. })
  1428.  
  1429. local Tile2 = Tab3:CreateSection("Setting")
  1430.  
  1431. -- Nút bật/tắt Team Check cho Tracer
  1432. local teamCheckToggle = Tab3:CreateToggle({
  1433. Name = "Team Check ESP",
  1434. Default = false,
  1435. Flag = "TeamcheckESP",
  1436. Callback = function(Value)
  1437. sound:Play()
  1438. _G.TeamCheckTracer = Value
  1439. _G.TeamCheck = Value
  1440. end
  1441. })
  1442.  
  1443. -- Slider chỉnh kích thước chữ ESP Name
  1444. local nameSizeSlider = Tab3:CreateSlider({
  1445. Name = "ESP Name font size",
  1446. Range = {10, 30},
  1447. Increment = 1,
  1448. CurrentValue = 12,
  1449. Flag = "SizeESPName",
  1450. Callback = function(Value)
  1451. _G.NameESPFontSize = Value
  1452. for _, nameTag in pairs(nameTags) do
  1453. nameTag.Size = Value
  1454. end
  1455. end
  1456. })
  1457.  
  1458. -- Slider chỉnh độ dày của tracer
  1459. local tracerThicknessSlider = Tab3:CreateSlider({
  1460. Name = "Tracer Thickness",
  1461. Range = {1, 5},
  1462. Increment = 1,
  1463. CurrentValue = 1,
  1464. Flag = "TracerThickness",
  1465. Callback = function(Value)
  1466. for _, tracer in pairs(tracers) do
  1467. tracer.Thickness = Value
  1468. end
  1469. end
  1470. })
  1471.  
  1472. Tab3:CreateSlider({
  1473. Name = "Box Border Thickness",
  1474. Range = {1, 5}, -- Giá trị từ 1 đến 5
  1475. Increment = 1, -- Tăng từng đơn vị
  1476. CurrentValue = BoxStroke, -- Giá trị mặc định
  1477. Flag = "Box Stroke",
  1478. Callback = function(Value)
  1479. UpdateStroke(Value)
  1480. end
  1481. })
  1482.  
  1483. Rayfield:LoadConfiguration()
Add Comment
Please, Sign In to add comment