portalfan_4324

My First Hub

Oct 20th, 2025
1,240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.60 KB | Source Code | 0 0
  1. local Rayfield = nil
  2. local success, lib = pcall(function()
  3.     return loadstring(game:HttpGet("https://sirius.menu/rayfield"))()
  4. end)
  5.  
  6. if success and lib then
  7.     Rayfield = lib
  8. else
  9.     warn("Failed to load Rayfield UI. Check connection or the library link.")
  10.     return
  11. end
  12.  
  13. -- =====================================
  14. -- Services & Globals
  15. -- =====================================
  16. local Players = game:GetService("Players")
  17. local RunService = game:GetService("RunService")
  18. local UserInputService = game:GetService("UserInputService")
  19. local TweenService = game:GetService("TweenService")
  20. local LocalPlayer = Players.LocalPlayer
  21. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  22. local Humanoid = Character:WaitForChild("Humanoid")
  23.  
  24. getgenv().UniversalSettings = getgenv().UniversalSettings or {
  25.     WalkSpeed = 16,
  26.     JumpPower = 50,
  27.     FlySpeed = 50,
  28.     ESPEnabled = false,
  29.     ChamsEnabled = false,
  30.     NametagsEnabled = true,
  31.     AntiAFK = true,
  32.     FlyEnabled = false,
  33. }
  34.  
  35. local Settings = getgenv().UniversalSettings
  36. local Highlights = {}
  37. local NametagHolder = {}
  38.  
  39. -- =====================================
  40. -- UI Window
  41. -- =====================================
  42. local Window = Rayfield:CreateWindow({
  43.     Name = "🌐 Clints Hub",
  44.     LoadingTitle = "Loading Clints Hub...",
  45.     LoadingSubtitle = "Rayfield UI",
  46.     ConfigurationSaving = {
  47.         Enabled = true,
  48.         FolderName = "UniversalHubConfig",
  49.         FileName = "RayfieldUniversal"
  50.     },
  51.     Discord = {
  52.         Enabled = false
  53.     },
  54.     KeySystem = false
  55. })
  56.  
  57. -- Tabs
  58. local mainTab = Window:CreateTab("Main", 4483345998)
  59. local playerTab = Window:CreateTab("Player", 4483345998)
  60. local visualsTab = Window:CreateTab("Visuals", 6023426915)
  61. local utilitiesTab = Window:CreateTab("Utilities", 4670953385)
  62. local settingsTab = Window:CreateTab("Settings", 6034818375)
  63.  
  64. -- =====================================
  65. -- Main Tab
  66. -- =====================================
  67. mainTab:CreateButton({
  68.     Name = "Reset Character",
  69.     Callback = function()
  70.         LocalPlayer:LoadCharacter()
  71.     end
  72. })
  73.  
  74. mainTab:CreateButton({
  75.     Name = "Center Camera on Character",
  76.     Callback = function()
  77.         if Character and Character:FindFirstChild("HumanoidRootPart") then
  78.             workspace.CurrentCamera.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 5, -10)
  79.         end
  80.     end
  81. })
  82.  
  83. mainTab:CreateButton({
  84.     Name = "Copy Player List",
  85.     Callback = function()
  86.         local names = {}
  87.         for _, p in pairs(Players:GetPlayers()) do
  88.             table.insert(names, p.Name)
  89.         end
  90.         pcall(function() setclipboard(table.concat(names, ", ")) end)
  91.         Rayfield:Notify({Title = "Copied", Content = "Player list copied to clipboard."})
  92.     end
  93. })
  94.  
  95. -- =====================================
  96. -- Player Tab
  97. -- =====================================
  98. playerTab:CreateSlider({
  99.     Name = "WalkSpeed",
  100.     Range = {8, 300},
  101.     Increment = 1,
  102.     Suffix = "studs/s",
  103.     CurrentValue = Settings.WalkSpeed,
  104.     Callback = function(Value)
  105.         Settings.WalkSpeed = Value
  106.         if Humanoid then Humanoid.WalkSpeed = Value end
  107.     end
  108. })
  109.  
  110. playerTab:CreateSlider({
  111.     Name = "JumpPower",
  112.     Range = {10, 300},
  113.     Increment = 1,
  114.     Suffix = "power",
  115.     CurrentValue = Settings.JumpPower,
  116.     Callback = function(Value)
  117.         Settings.JumpPower = Value
  118.         if Humanoid then Humanoid.JumpPower = Value end
  119.     end
  120. })
  121.  
  122. -- ✈️ Fly Toggle
  123. playerTab:CreateToggle({
  124.     Name = "Enable Fly",
  125.     CurrentValue = Settings.FlyEnabled,
  126.     Callback = function(state)
  127.         Settings.FlyEnabled = state
  128.         local root = Character:FindFirstChild("HumanoidRootPart")
  129.         if not root then return end
  130.  
  131.         if state then
  132.             local bv = Instance.new("BodyVelocity")
  133.             bv.Name = "FlyBV"
  134.             bv.MaxForce = Vector3.new(1e5, 1e5, 1e5)
  135.             bv.Parent = root
  136.  
  137.             local bg = Instance.new("BodyGyro")
  138.             bg.Name = "FlyBG"
  139.             bg.MaxTorque = Vector3.new(4e5, 4e5, 4e5)
  140.             bg.CFrame = root.CFrame
  141.             bg.Parent = root
  142.  
  143.             local flySpeed = Settings.FlySpeed
  144.             local moveDir = Vector3.new()
  145.  
  146.             local keys = {W=false,S=false,A=false,D=false,Space=false,Shift=false}
  147.  
  148.             local function update()
  149.                 local cam = workspace.CurrentCamera
  150.                 local dir = Vector3.new()
  151.                 if keys.W then dir = dir + cam.CFrame.LookVector end
  152.                 if keys.S then dir = dir - cam.CFrame.LookVector end
  153.                 if keys.A then dir = dir - cam.CFrame.RightVector end
  154.                 if keys.D then dir = dir + cam.CFrame.RightVector end
  155.                 if keys.Space then dir = dir + Vector3.new(0,1,0) end
  156.                 if keys.Shift then dir = dir - Vector3.new(0,1,0) end
  157.                 if dir.Magnitude > 0 then
  158.                     bv.Velocity = dir.Unit * flySpeed
  159.                     bg.CFrame = CFrame.new(root.Position, root.Position + cam.CFrame.LookVector)
  160.                 else
  161.                     bv.Velocity = Vector3.new()
  162.                 end
  163.             end
  164.  
  165.             local inputBegan = UserInputService.InputBegan:Connect(function(input, gpe)
  166.                 if gpe then return end
  167.                 if input.KeyCode == Enum.KeyCode.W then keys.W = true end
  168.                 if input.KeyCode == Enum.KeyCode.S then keys.S = true end
  169.                 if input.KeyCode == Enum.KeyCode.A then keys.A = true end
  170.                 if input.KeyCode == Enum.KeyCode.D then keys.D = true end
  171.                 if input.KeyCode == Enum.KeyCode.Space then keys.Space = true end
  172.                 if input.KeyCode == Enum.KeyCode.LeftShift then keys.Shift = true end
  173.             end)
  174.  
  175.             local inputEnded = UserInputService.InputEnded:Connect(function(input)
  176.                 if input.KeyCode == Enum.KeyCode.W then keys.W = false end
  177.                 if input.KeyCode == Enum.KeyCode.S then keys.S = false end
  178.                 if input.KeyCode == Enum.KeyCode.A then keys.A = false end
  179.                 if input.KeyCode == Enum.KeyCode.D then keys.D = false end
  180.                 if input.KeyCode == Enum.KeyCode.Space then keys.Space = false end
  181.                 if input.KeyCode == Enum.KeyCode.LeftShift then keys.Shift = false end
  182.             end)
  183.  
  184.             local step = RunService.RenderStepped:Connect(update)
  185.  
  186.             Settings._FlyCleanup = function()
  187.                 inputBegan:Disconnect()
  188.                 inputEnded:Disconnect()
  189.                 step:Disconnect()
  190.                 bv:Destroy()
  191.                 bg:Destroy()
  192.             end
  193.         else
  194.             if Settings._FlyCleanup then
  195.                 Settings._FlyCleanup()
  196.                 Settings._FlyCleanup = nil
  197.             end
  198.         end
  199.     end
  200. })
  201.  
  202. playerTab:CreateInput({
  203.     Name = "Teleport to Player",
  204.     PlaceholderText = "Player Name",
  205.     RemoveTextAfterFocusLost = true,
  206.     Callback = function(val)
  207.         local target = Players:FindFirstChild(val)
  208.         if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
  209.             Character:WaitForChild("HumanoidRootPart").CFrame = target.Character.HumanoidRootPart.CFrame + Vector3.new(0,3,0)
  210.         else
  211.             Rayfield:Notify({Title="Teleport Failed", Content="Player not found or no HRP."})
  212.         end
  213.     end
  214. })
  215.  
  216. playerTab:CreateButton({
  217.     Name = "Teleport to Mouse",
  218.     Callback = function()
  219.         local mouse = LocalPlayer:GetMouse()
  220.         if mouse and mouse.Hit then
  221.             Character:WaitForChild("HumanoidRootPart").CFrame = mouse.Hit + Vector3.new(0,3,0)
  222.         end
  223.     end
  224. })
  225.  
  226. -- =====================================
  227. -- Visuals Tab
  228. -- =====================================
  229.  
  230. local function createHighlight(char, color)
  231.     if not char or Highlights[char] then return end
  232.     local h = Instance.new("Highlight")
  233.     h.Name = "ESPHighlight"
  234.     h.Adornee = char
  235.     h.FillColor = color or Color3.fromHSV(tick()%10/10,1,1)
  236.     h.FillTransparency = 0.5
  237.     h.OutlineTransparency = 0.4
  238.     h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  239.     h.Parent = game:GetService("CoreGui")
  240.     Highlights[char] = h
  241. end
  242.  
  243. local function removeHighlight(char)
  244.     if Highlights[char] then
  245.         Highlights[char]:Destroy()
  246.         Highlights[char] = nil
  247.     end
  248. end
  249.  
  250. visualsTab:CreateToggle({
  251.     Name = "ESP",
  252.     CurrentValue = Settings.ESPEnabled,
  253.     Callback = function(state)
  254.         Settings.ESPEnabled = state
  255.         if not state then
  256.             for c,_ in pairs(Highlights) do removeHighlight(c) end
  257.         else
  258.             for _,p in pairs(Players:GetPlayers()) do
  259.                 if p ~= LocalPlayer and p.Character then createHighlight(p.Character) end
  260.             end
  261.         end
  262.     end
  263. })
  264.  
  265. visualsTab:CreateToggle({
  266.     Name = "Chams",
  267.     CurrentValue = Settings.ChamsEnabled,
  268.     Callback = function(state)
  269.         Settings.ChamsEnabled = state
  270.         for _, p in pairs(Players:GetPlayers()) do
  271.             if p ~= LocalPlayer and p.Character then
  272.                 for _, part in pairs(p.Character:GetDescendants()) do
  273.                     if part:IsA("BasePart") then
  274.                         if state then
  275.                             if not part:FindFirstChild("Cham") then
  276.                                 local box = Instance.new("SelectionBox")
  277.                                 box.Name = "Cham"
  278.                                 box.Adornee = part
  279.                                 box.Parent = part
  280.                             end
  281.                         else
  282.                             if part:FindFirstChild("Cham") then
  283.                                 part.Cham:Destroy()
  284.                             end
  285.                         end
  286.                     end
  287.                 end
  288.             end
  289.         end
  290.     end
  291. })
  292.  
  293. visualsTab:CreateToggle({
  294.     Name = "Nametags",
  295.     CurrentValue = Settings.NametagsEnabled,
  296.     Callback = function(state)
  297.         Settings.NametagsEnabled = state
  298.         if not state then
  299.             for _, gui in pairs(NametagHolder) do
  300.                 if gui then gui:Destroy() end
  301.             end
  302.             NametagHolder = {}
  303.         end
  304.     end
  305. })
  306.  
  307. -- =====================================
  308. -- Utilities Tab
  309. -- =====================================
  310.  
  311. utilitiesTab:CreateToggle({
  312.     Name = "Anti-AFK",
  313.     CurrentValue = Settings.AntiAFK,
  314.     Callback = function(state)
  315.         Settings.AntiAFK = state
  316.         if state then
  317.             getgenv().AntiAFKConnection = game:GetService("UserInputService").Idled:Connect(function()
  318.                 game:GetService("VirtualUser"):ClickButton2(Vector2.new())
  319.             end)
  320.         else
  321.             if getgenv().AntiAFKConnection then
  322.                 getgenv().AntiAFKConnection:Disconnect()
  323.                 getgenv().AntiAFKConnection = nil
  324.             end
  325.         end
  326.     end
  327. })
  328.  
  329. utilitiesTab:CreateButton({
  330.     Name = "Get Nearest Player",
  331.     Callback = function()
  332.         local root = Character:FindFirstChild("HumanoidRootPart")
  333.         if not root then return end
  334.         local nearest, dist = nil, math.huge
  335.         for _, p in pairs(Players:GetPlayers()) do
  336.             if p ~= LocalPlayer and p.Character and p.Character:FindFirstChild("HumanoidRootPart") then
  337.                 local d = (p.Character.HumanoidRootPart.Position - root.Position).Magnitude
  338.                 if d < dist then
  339.                     nearest = p
  340.                     dist = d
  341.                 end
  342.             end
  343.         end
  344.         if nearest then
  345.             Rayfield:Notify({Title="Nearest Player", Content=nearest.Name.." ("..math.floor(dist).." studs)"})
  346.         else
  347.             Rayfield:Notify({Title="Nearest Player", Content="No one nearby"})
  348.         end
  349.     end
  350. })
  351.  
  352. -- =====================================
  353. -- Settings Tab
  354. -- =====================================
  355.  
  356. settingsTab:CreateKeybind({
  357.     Name = "Toggle UI",
  358.     CurrentKeybind = Enum.KeyCode.RightShift,
  359.     HoldToInteract = false,
  360.     Callback = function()
  361.         Rayfield:Toggle()
  362.     end
  363. })
  364.  
  365. settingsTab:CreateInput({
  366.     Name = "Set Fly Speed",
  367.     PlaceholderText = tostring(Settings.FlySpeed),
  368.     RemoveTextAfterFocusLost = true,
  369.     Callback = function(val)
  370.         local n = tonumber(val)
  371.         if n then Settings.FlySpeed = n end
  372.     end
  373. })
  374.  
  375. settingsTab:CreateButton({
  376.     Name = "Unload Script",
  377.     Callback = function()
  378.         for c,_ in pairs(Highlights) do removeHighlight(c) end
  379.         if getgenv().AntiAFKConnection then
  380.             getgenv().AntiAFKConnection:Disconnect()
  381.             getgenv().AntiAFKConnection = nil
  382.         end
  383.         Rayfield:Destroy()
  384.     end
  385. })
  386.  
  387. -- =====================================
  388. -- Nametags Runtime
  389. -- =====================================
  390. RunService.Heartbeat:Connect(function()
  391.     for _, p in pairs(Players:GetPlayers()) do
  392.         if p ~= LocalPlayer then
  393.             if Settings.NametagsEnabled and p.Character and p.Character:FindFirstChild("Head") then
  394.                 if not NametagHolder[p] then
  395.                     local gui = Instance.new("BillboardGui")
  396.                     gui.Name = "Nametag"
  397.                     gui.Size = UDim2.new(0,150,0,50)
  398.                     gui.StudsOffset = Vector3.new(0,2.5,0)
  399.                     gui.AlwaysOnTop = true
  400.                     gui.MaxDistance = 1000
  401.  
  402.                     local label = Instance.new("TextLabel", gui)
  403.                     label.Size = UDim2.new(1,0,1,0)
  404.                     label.BackgroundTransparency = 1
  405.                     label.Text = p.Name
  406.                     label.TextColor3 = Color3.fromRGB(255,255,255)
  407.                     label.Font = Enum.Font.SourceSansBold
  408.                     label.TextScaled = true
  409.                     label.TextStrokeTransparency = 0.6
  410.  
  411.                     gui.Parent = p.Character.Head
  412.                     NametagHolder[p] = gui
  413.                 end
  414.             else
  415.                 if NametagHolder[p] then
  416.                     NametagHolder[p]:Destroy()
  417.                     NametagHolder[p] = nil
  418.                 end
  419.             end
  420.         end
  421.     end
  422. end)
  423.  
  424. -- =====================================
  425. -- Keep WS/JP synced
  426. -- =====================================
  427. RunService.Heartbeat:Connect(function()
  428.     if Humanoid then
  429.         if Humanoid.WalkSpeed ~= Settings.WalkSpeed then
  430.             Humanoid.WalkSpeed = Settings.WalkSpeed
  431.         end
  432.         if Humanoid.JumpPower ~= Settings.JumpPower then
  433.             Humanoid.JumpPower = Settings.JumpPower
  434.         end
  435.     end
  436. end)
  437.  
  438. Rayfield:Notify({Title="✅ Universal Hub", Content="Rayfield version loaded. RightShift to toggle UI."})
  439.  
Advertisement
Add Comment
Please, Sign In to add comment