local cloneref = cloneref or function(x) return x end
local Workspace = cloneref(game:GetService("Workspace"))
local Players = cloneref(game:GetService("Players"))
local RunService = cloneref(game:GetService("RunService"))
local UIS = cloneref(game:GetService("UserInputService"))
local Lighting = cloneref(game:GetService("Lighting"))
local CoreGui = cloneref(game:GetService("CoreGui"))
local LocalPlayer = Players.LocalPlayer
local Camera = Workspace.CurrentCamera
local trident = { middlepart = nil, tcp = nil, original_model = nil }
repeat
local ok = pcall(function()
trident.middlepart = Workspace.Const.Ignore.LocalCharacter.Middle
trident.tcp = LocalPlayer and LocalPlayer.TCP
trident.original_model = game:GetService("ReplicatedStorage").Shared.entities.Player.Model
end)
if not ok or not (trident.middlepart and trident.tcp and trident.original_model) then task.wait(0.25) end
until trident.middlepart and trident.tcp and trident.original_model
local okRF, Rayfield = pcall(function()
end)
if not okRF or not Rayfield then
warn("Rayfield не загрузился. Проверь HttpGet/экзекьютор.")
return
end
local Window = Rayfield:CreateWindow({
Name = "Deluxed Hub | Trident Survival",
Icon = 0,
LoadingTitle = "Deluxed Hub <3",
LoadingSubtitle = "Trident Survival",
ShowText = "Del3xed",
Theme = "Default",
ToggleUIKeybind = "L",
DisableRayfieldPrompts = false,
DisableBuildWarnings = false,
ConfigurationSaving = {
Enabled = true,
FolderName = "deluxedhub_rf",
FileName = "config_rf"
}
})
local ESPTab = Window:CreateTab("ESP (Head)")
local ESP = {
enabled = true,
showName = false,
showDistance = true,
colorByDistance = true,
textColor = Color3.fromRGB(0,255,0),
textStroke = true,
textSize = 16,
bbWidth = 160,
bbHeight = 42,
studsOffsetY = 2,
maxDistance = 10000, -- 0 = бесконечность
alwaysOnTop = true,
ignoreLocalHead = true,
}
local Heads = {} -- [BasePart] = {bill=BillboardGui, label=TextLabel, ancestryCon=RBXScriptConnection}
local function isLocalHead(part)
local char = LocalPlayer and LocalPlayer.Character
if not char then return false end
local h = char:FindFirstChild("Head")
return h == part
end
local function applyVisualToOne(head, data)
local bill, label = data.bill, data.label
bill.Enabled = ESP.enabled
bill.AlwaysOnTop = ESP.alwaysOnTop
bill.Size = UDim2.new(0, ESP.bbWidth, 0, ESP.bbHeight)
bill.StudsOffset = Vector3.new(0, ESP.studsOffsetY, 0)
pcall(function()
bill.MaxDistance = (ESP.maxDistance and ESP.maxDistance > 0) and ESP.maxDistance or math.huge
end)
label.TextStrokeTransparency = ESP.textStroke and 0 or 1
label.TextScaled = false
label.TextSize = ESP.textSize
if not ESP.colorByDistance then
label.TextColor3 = ESP.textColor
end
end
local function applyVisualToAll()
for head, data in pairs(Heads) do
if head and head.Parent and data and data.label then
applyVisualToOne(head, data)
end
end
end
local function removeHead(head)
local data = Heads[head]
if not data then return end
if data.ancestryCon then data.ancestryCon:Disconnect() end
if data.bill then data.bill:Destroy() end
Heads[head] = nil
end
local function createHeadESP(head)
if not head or not head:IsA("BasePart") or head.Name ~= "Head" then return end
if ESP.ignoreLocalHead and isLocalHead(head) then return end
if Heads[head] or head:FindFirstChild("HeadESP") then return end
local bill = Instance.new("BillboardGui")
bill.Name = "HeadESP"
bill.Adornee = head
bill.AlwaysOnTop = ESP.alwaysOnTop
bill.Size = UDim2.new(0, ESP.bbWidth, 0, ESP.bbHeight)
bill.StudsOffset = Vector3.new(0, ESP.studsOffsetY, 0)
bill.Enabled = ESP.enabled
pcall(function()
bill.MaxDistance = (ESP.maxDistance and ESP.maxDistance > 0) and ESP.maxDistance or math.huge
end)
-- аккуратный фон с округлением
local bg = Instance.new("Frame")
bg.BackgroundTransparency = 0.25
bg.BackgroundColor3 = Color3.fromRGB(20,20,25)
bg.Size = UDim2.new(1,0,1,0)
bg.Parent = bill
local corner = Instance.new("UICorner"); corner.CornerRadius = UDim.new(0, 10); corner.Parent = bg
local stroke = Instance.new("UIStroke"); stroke.Thickness = 1; stroke.Color = Color3.fromRGB(60,60,75); stroke.Parent = bg
local label = Instance.new("TextLabel")
label.BackgroundTransparency = 1
label.Text = "..."
label.TextColor3 = ESP.textColor
label.TextStrokeTransparency = ESP.textStroke and 0 or 1
label.Font = Enum.Font.GothamBold
label.TextScaled = false
label.TextSize = ESP.textSize
label.Size = UDim2.new(1, 0, 1, 0)
label.ZIndex = 2
label.Parent = bill
bill.Parent = head
local ancestryCon = head.AncestryChanged:Connect(function()
if not head:IsDescendantOf(Workspace) then
removeHead(head)
end
end)
Heads[head] = { bill = bill, label = label, ancestryCon = ancestryCon }
applyVisualToOne(head, Heads[head])
end
local function rescanHeads()
for head in pairs(Heads) do removeHead(head) end
for _, inst in ipairs(Workspace:GetDescendants()) do
if inst:IsA("BasePart") and inst.Name == "Head" then
createHeadESP(inst)
end
end
end
-- init + watch
rescanHeads()
Workspace.DescendantAdded:Connect(function(inst)
if inst:IsA("BasePart") and inst.Name == "Head" then
createHeadESP(inst)
end
end)
-- обновление текста/цвета
RunService.RenderStepped:Connect(function()
local origin
local char = LocalPlayer and LocalPlayer.Character
if char then
local hrp = char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
origin = hrp and hrp.Position
end
origin = origin or (Camera and Camera.CFrame.Position) or Vector3.new()
for head, data in pairs(Heads) do
if head and head.Parent and data and data.label then
local d = math.floor((head.Position - origin).Magnitude + 0.5)
local nameText = (ESP.showName and (head.Parent and head.Parent.Name or "Head")) or nil
local distText = (ESP.showDistance and string.format("[%d м]", d)) or nil
if nameText and distText then
data.label.Text = nameText .. " " .. distText
elseif nameText then
data.label.Text = nameText
elseif distText then
data.label.Text = distText
else
data.label.Text = ""
end
if ESP.colorByDistance then
if d < 15 then
data.label.TextColor3 = Color3.fromRGB(255, 60, 60)
elseif d < 40 then
data.label.TextColor3 = Color3.fromRGB(255, 220, 0)
else
data.label.TextColor3 = Color3.fromRGB(0, 255, 0)
end
end
end
end
end)
-- Rayfield UI (ESP)
ESPTab:CreateToggle({ Name = "ESP Enabled", CurrentValue = ESP.enabled, Callback=function(v) ESP.enabled=v; applyVisualToAll() end })
ESPTab:CreateToggle({ Name = "Показывать имя модели", CurrentValue = ESP.showName, Callback=function(v) ESP.showName=v end })
ESPTab:CreateToggle({ Name = "Показывать дистанцию", CurrentValue = ESP.showDistance, Callback=function(v) ESP.showDistance=v end })
ESPTab:CreateToggle({ Name = "Цвет по расстоянию", CurrentValue = ESP.colorByDistance, Callback=function(v) ESP.colorByDistance=v; applyVisualToAll() end })
ESPTab:CreateToggle({ Name = "Обводка текста", CurrentValue = ESP.textStroke, Callback=function(v) ESP.textStroke=v; applyVisualToAll() end })
ESPTab:CreateToggle({ Name = "AlwaysOnTop", CurrentValue = ESP.alwaysOnTop, Callback=function(v) ESP.alwaysOnTop=v; applyVisualToAll() end })
ESPTab:CreateToggle({ Name = "Игнорировать свою голову", CurrentValue = ESP.ignoreLocalHead, Callback=function(v) ESP.ignoreLocalHead=v; rescanHeads() end })
ESPTab:CreateColorPicker({ Name = "Цвет текста (если выкл. окраску по дистанции)", Color = ESP.textColor, Callback=function(c) ESP.textColor=c; if not ESP.colorByDistance then applyVisualToAll() end end })
ESPTab:CreateSlider({ Name="Размер текста", Range={10,72}, Increment=1, CurrentValue=ESP.textSize, Callback=function(val) ESP.textSize=math.floor(val); applyVisualToAll() end })
ESPTab:CreateSlider({ Name="Ширина Billboard", Range={80,400}, Increment=2, CurrentValue=ESP.bbWidth, Callback=function(val) ESP.bbWidth=math.floor(val); applyVisualToAll() end })
ESPTab:CreateSlider({ Name="Высота Billboard", Range={24,200}, Increment=2, CurrentValue=ESP.bbHeight, Callback=function(val) ESP.bbHeight=math.floor(val); applyVisualToAll() end })
ESPTab:CreateSlider({ Name="OffsetY", Range={-10,12}, Increment=0.5, CurrentValue=ESP.studsOffsetY, Callback=function(val) ESP.studsOffsetY=val; applyVisualToAll() end })
ESPTab:CreateSlider({ Name="MaxDistance (0 = бесконечно)", Range={0,20000}, Increment=50, CurrentValue=ESP.maxDistance, Callback=function(val) ESP.maxDistance=math.max(0, math.floor(val)); applyVisualToAll() end })
ESPTab:CreateButton({ Name="Rescan (пересканировать головы)", Callback = rescanHeads })
ESPTab:CreateButton({
Name="Reset (сброс настроек)",
Callback=function()
ESP = {
enabled = true, showName=false, showDistance=true, colorByDistance=true,
textColor=Color3.fromRGB(0,255,0), textStroke=true, textSize=16,
bbWidth=160, bbHeight=42, studsOffsetY=2, maxDistance=10000,
alwaysOnTop=true, ignoreLocalHead=true
}
applyVisualToAll()
rescanHeads()
end
})
-- ========== TimeChanger ==========
local WorldTab = Window:CreateTab("World")
local timeEnabled, timeVal = false, math.floor(Lighting.ClockTime + 0.5)
WorldTab:CreateToggle({ Name="Time changer", CurrentValue=false, Callback=function(v) timeEnabled=v end })
WorldTab:CreateSlider({ Name="ClockTime", Range={0,24}, Increment=0.1, CurrentValue=timeVal, Callback=function(v) timeVal=v end })
RunService.Heartbeat:Connect(function()
if timeEnabled then Lighting.ClockTime = timeVal end
end)
-- ========== SpeedHack ==========
local SpeedTab = Window:CreateTab("SpeedHack")
local Speed = {
enabled=false, forceSprint=false,
speed=55, minSpeed=17, decay=20, sprintSpeed=18,
requireShift=true, holdKey=Enum.KeyCode.C
}
local boost, t, lastActive = Speed.speed, 0, false
local function getMiddle()
if trident.middlepart and trident.middlepart.Parent then return trident.middlepart end
local ok = pcall(function()
trident.middlepart = Workspace.Const.Ignore.LocalCharacter.Middle
end)
if ok then return trident.middlepart end
return nil
end
local function flat(v) return Vector3.new(v.X,0,v.Z) end
local function getMoveDir()
local look = flat(Camera.CFrame.LookVector)
if look.Magnitude < 1e-6 then look = Vector3.new(0,0,-1) end
look = look.Unit
local right = Vector3.new(-look.Z,0,look.X)
local dir = Vector3.zero
if UIS:IsKeyDown(Enum.KeyCode.W) then dir += look end
if UIS:IsKeyDown(Enum.KeyCode.S) then dir -= look end
if UIS:IsKeyDown(Enum.KeyCode.D) then dir += right end
if UIS:IsKeyDown(Enum.KeyCode.A) then dir -= right end
if dir.Magnitude > 1e-6 then dir = dir.Unit end
return dir
end
RunService.RenderStepped:Connect(function(dt)
local mid = getMiddle()
if not mid then boost=Speed.speed; t=0; lastActive=false; return end
local keyC = UIS:IsKeyDown(Speed.holdKey)
local shiftOK = (not Speed.requireShift) or UIS:IsKeyDown(Enum.KeyCode.LeftShift)
local dir = getMoveDir()
local active = Speed.enabled and keyC and shiftOK and (dir ~= Vector3.zero)
if active then
if t==0 then
mid.CFrame = mid.CFrame + Vector3.new(0,6.5,0)
end
boost = math.clamp(boost - dt*Speed.decay, Speed.minSpeed, Speed.speed)
local y = (t < 0.85) and 0 or -7
mid.AssemblyLinearVelocity = Vector3.new(dir.X*boost, y, dir.Z*boost)
t += dt
lastActive = true
else
if lastActive then boost=Speed.speed; t=0; lastActive=false end
if Speed.forceSprint and (dir ~= Vector3.zero) then
local v = mid.AssemblyLinearVelocity
mid.AssemblyLinearVelocity = Vector3.new(dir.X*Speed.sprintSpeed, v.Y, dir.Z*Speed.sprintSpeed)
end
end
end)
SpeedTab:CreateToggle({ Name="enabled", CurrentValue=Speed.enabled, Callback=function(v) Speed.enabled=v; if not v then boost=Speed.speed; t=0; lastActive=false end end })
SpeedTab:CreateToggle({ Name="forcesprint", CurrentValue=Speed.forceSprint, Callback=function(v) Speed.forceSprint=v end })
SpeedTab:CreateSlider({ Name="speed", Range={55,70}, Increment=1, Suffix="sps", CurrentValue=Speed.speed, Callback=function(v) Speed.speed=math.floor(v); boost=Speed.speed end })
SpeedTab:CreateSection("Дополнительно")
SpeedTab:CreateToggle({ Name="требовать LeftShift с C", CurrentValue=Speed.requireShift, Callback=function(v) Speed.requireShift=v end })
SpeedTab:CreateSlider({ Name="minSpeed", Range={10,30}, Increment=1, CurrentValue=Speed.minSpeed, Callback=function(v) Speed.minSpeed=math.floor(v) end })
SpeedTab:CreateSlider({ Name="decay", Range={5,40}, Increment=1, Suffix="/s", CurrentValue=Speed.decay, Callback=function(v) Speed.decay=math.floor(v) end })
SpeedTab:CreateSlider({ Name="force sprint speed", Range={10,40}, Increment=1, CurrentValue=Speed.sprintSpeed, Callback=function(v) Speed.sprintSpeed=math.floor(v) end })
-- ========== Hitbox Expander (Head) ==========
local HitboxTab = Window:CreateTab("Hitbox")
local hb = { enabled=false, canCollide=false, transp=0.5, sizeX=10, sizeY=10 }
local original_head_size = trident.original_model and trident.original_model:FindFirstChild("Head") and trident.original_model.Head.Size or Vector3.new(2,1,1)
-- кэш валидных персонажей (модели с Head и LowerTorso)
local valid = {}
local function addValid(m)
if m:IsA("Model") and m:FindFirstChild("Head") and (m:FindFirstChild("LowerTorso") or m:FindFirstChild("HumanoidRootPart")) then
valid[m] = true
end
end
local function removeValid(m)
if valid[m] then valid[m] = nil end
end
for _,v in ipairs(Workspace:GetChildren()) do addValid(v) end
Workspace.ChildAdded:Connect(addValid)
Workspace.ChildRemoved:Connect(removeValid)
-- основной цикл
RunService.Heartbeat:Connect(function()
if hb.enabled then
local size = Vector3.new(hb.sizeX, hb.sizeY, hb.sizeX)
for m in pairs(valid) do
local head = m and m:FindFirstChild("Head")
if head and head:IsA("BasePart") then
head.Size = size
head.Transparency = hb.transp
head.CanCollide = hb.canCollide
end
end
end
end)
local function restoreHeads()
for m in pairs(valid) do
local head = m and m:FindFirstChild("Head")
if head and head:IsA("BasePart") then
head.Size = original_head_size
head.Transparency = 0
head.CanCollide = true
end
end
end
HitboxTab:CreateToggle({ Name="hitbox expander", CurrentValue=false, Callback=function(v)
hb.enabled = v
if not v then restoreHeads() end
end })
HitboxTab:CreateToggle({ Name="can collide", CurrentValue=hb.canCollide, Callback=function(v) hb.canCollide=v end })
HitboxTab:CreateSlider({ Name="transparency", Range={0,1}, Increment=0.05, CurrentValue=hb.transp, Callback=function(v) hb.transp=v end })
HitboxTab:CreateSlider({ Name="size XZ", Range={1,15}, Increment=1, CurrentValue=hb.sizeX, Callback=function(v) hb.sizeX=math.floor(v) end })
HitboxTab:CreateSlider({ Name="size Y", Range={1,15}, Increment=1, CurrentValue=hb.sizeY, Callback=function(v) hb.sizeY=math.floor(v) end })
HitboxTab:CreateButton({ Name="Restore original", Callback=restoreHeads })
-- ========== Car Fly (ATV) ==========
local CarTab = Window:CreateTab("Car Fly")
local carSettings = { enabled=false, speed=150, upspeed=15, accel=100 }
CarTab:CreateToggle({ Name="car fly enabled", CurrentValue=false, Callback=function(v) carSettings.enabled=v end })
CarTab:CreateSlider({ Name="speed", Range={50,300}, Increment=1, Suffix="sps", CurrentValue=carSettings.speed, Callback=function(v) carSettings.speed=math.floor(v) end })
CarTab:CreateSlider({ Name="up speed", Range={5,100}, Increment=1, Suffix="sps", CurrentValue=carSettings.upspeed, Callback=function(v) carSettings.upspeed=math.floor(v) end })
CarTab:CreateSlider({ Name="acceleration", Range={10,300}, Increment=1, CurrentValue=carSettings.accel, Callback=function(v) carSettings.accel=math.floor(v) end })
CarTab:CreateLabel("Управление: WASD, V (вверх), B (вниз)")
local car, lastDist = nil, 50
local function findCar()
car, lastDist = nil, 50
for _,v in ipairs(Workspace:GetChildren()) do
if v:FindFirstChild("Seat") and v:FindFirstChild("Frame") then
local mp = trident.middlepart or (Workspace.Const and Workspace.Const.Ignore and Workspace.Const.Ignore.LocalCharacter and Workspace.Const.Ignore.LocalCharacter.Middle)
if mp then
local d = (v.Frame.Position - mp.Position).Magnitude
if d < lastDist then
car = v
lastDist = d
end
end
end
end
end
findCar()
local buildup = 0
local lastdir = Vector3.new(1,0,0)
RunService.RenderStepped:Connect(function(dt)
if not carSettings.enabled then buildup = 0 return end
if not car or not car:FindFirstChild("Frame") then
findCar()
buildup = 0
return
end
if (car.Frame.CFrame.Position - Camera.CFrame.Position).Magnitude > 50 then
findCar()
buildup = 0
return
end
local cam = Camera.CFrame.LookVector
cam = Vector3.new(cam.X, 0, cam.Z)
local dir = Vector3.zero
if UIS:IsKeyDown(Enum.KeyCode.W) then dir += cam end
if UIS:IsKeyDown(Enum.KeyCode.S) then dir -= cam end
if UIS:IsKeyDown(Enum.KeyCode.D) then dir += Vector3.new(-cam.Z, 0, cam.X) end
if UIS:IsKeyDown(Enum.KeyCode.A) then dir += Vector3.new(cam.Z, 0, -cam.X) end
if UIS:IsKeyDown(Enum.KeyCode.V) then dir += Vector3.yAxis end
if UIS:IsKeyDown(Enum.KeyCode.B) then dir -= Vector3.yAxis end
if dir ~= Vector3.zero then
dir = dir.Unit
if dir.Y == 0 then
buildup = math.clamp(buildup + dt*carSettings.accel, 0, carSettings.speed)
lastdir = dir
end
else
dir = lastdir
buildup = math.clamp(buildup - dt*150, 0, carSettings.speed)
end
for _,part in ipairs(car:GetChildren()) do
if part:IsA("BasePart") then
part.AssemblyLinearVelocity = Vector3.new(dir.X*buildup, dir.Y*carSettings.upspeed, dir.Z*buildup)
end
end
end)
-- Add Freecam tab to existing Rayfield Window (do not create a new Window)
-- Controls: WASD move, E/Q up/down, Shift sprint, mouse look (RMB if enabled)
do
local Workspace = game:GetService("Workspace")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local Camera = Workspace.CurrentCamera
-- State
local Free = {
enabled = false,
speed = 25, -- studs/sec
sprintMult = 3, -- multiplier when holding LeftShift
mouseLookHoldRMB = true,
sensitivity = 0.0025 -- mouse sensitivity
}
local savedCam = nil
local fcPos, yaw, pitch = nil, 0, 0
local mouseDelta = Vector2.zero
-- Mouse delta capture (only once)
local _icConn = UIS.InputChanged:Connect(function(input)
if not Free.enabled then return end
if input.UserInputType == Enum.UserInputType.MouseMovement then
if (not Free.mouseLookHoldRMB) or UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
mouseDelta = input.Delta
else
mouseDelta = Vector2.zero
end
end
end)
local function enableFreecam()
if Free.enabled then return end
Free.enabled = true
savedCam = {
type = Camera.CameraType,
subject = Camera.CameraSubject,
cframe = Camera.CFrame,
fov = Camera.FieldOfView
}
Camera.CameraType = Enum.CameraType.Scriptable
fcPos = Camera.CFrame.Position
local look = Camera.CFrame.LookVector
yaw = math.atan2(look.X, look.Z)
pitch = math.asin(math.clamp(look.Y, -0.999, 0.999))
end
local function disableFreecam()
if not Free.enabled then return end
Free.enabled = false
mouseDelta = Vector2.zero
if savedCam then
Camera.CameraType = savedCam.type
Camera.CameraSubject = savedCam.subject
Camera.CFrame = savedCam.cframe
Camera.FieldOfView = savedCam.fov
else
Camera.CameraType = Enum.CameraType.Custom
end
end
-- Movement/update (only once)
local _rsConn = RunService.RenderStepped:Connect(function(dt)
if not Free.enabled then return end
-- Mouse look
if mouseDelta.Magnitude ~= 0 then
yaw = yaw - mouseDelta.X * Free.sensitivity
pitch = math.clamp(pitch - mouseDelta.Y * Free.sensitivity, -1.55, 1.55)
mouseDelta = Vector2.zero
end
local rot = CFrame.Angles(0, yaw, 0) * CFrame.Angles(pitch, 0, 0)
local fwd = rot.LookVector
local right = rot.RightVector
local up = Vector3.yAxis
-- Move
local dir = Vector3.zero
if UIS:IsKeyDown(Enum.KeyCode.W) then dir += fwd end
if UIS:IsKeyDown(Enum.KeyCode.S) then dir -= fwd end
if UIS:IsKeyDown(Enum.KeyCode.D) then dir += right end
if UIS:IsKeyDown(Enum.KeyCode.A) then dir -= right end
if UIS:IsKeyDown(Enum.KeyCode.E) then dir += up end
if UIS:IsKeyDown(Enum.KeyCode.Q) then dir -= up end
if dir.Magnitude > 0 then dir = dir.Unit end
local speed = Free.speed * (UIS:IsKeyDown(Enum.KeyCode.LeftShift) and Free.sprintMult or 1)
fcPos = fcPos + dir * speed * dt
Camera.CFrame = CFrame.new(fcPos) * rot
end)
-- Require existing Window
if not Window or type(Window) ~= "table" or not Window.CreateTab then
warn("Freecam tab: expected global 'Window' (Rayfield window) to exist")
return
end
-- UI: add Freecam tab
local FreeTab = Window:CreateTab("Freecam")
FreeTab:CreateToggle({
Name = "Freecam enabled",
CurrentValue = false,
Callback = function(v)
if v then enableFreecam() else disableFreecam() end
end
})
FreeTab:CreateSlider({
Name = "Speed",
Range = {5, 300},
Increment = 1,
CurrentValue = Free.speed,
Suffix = "st/s",
Callback = function(val) Free.speed = math.floor(val) end
})
FreeTab:CreateSlider({
Name = "Sprint multiplier (Shift)",
Range = {1, 10},
Increment = 0.5,
CurrentValue = Free.sprintMult,
Callback = function(val) Free.sprintMult = val end
})
FreeTab:CreateToggle({
Name = "Mouse look only on RMB",
CurrentValue = Free.mouseLookHoldRMB,
Callback = function(v) Free.mouseLookHoldRMB = v end
})
FreeTab:CreateSlider({
Name = "Mouse sensitivity",
Range = {0.0005, 0.01},
Increment = 0.0005,
CurrentValue = Free.sensitivity,
Callback = function(val) Free.sensitivity = val end
})
FreeTab:CreateKeybind({
Name = "Toggle Freecam (keybind)",
CurrentKeybind = "F",
HoldToInteract = false,
Callback = function()
if Free.enabled then disableFreecam() else enableFreecam() end
end
})
-- Optional: expose quick API
_G.FreecamTab = {
Enable = enableFreecam,
Disable = disableFreecam,
IsEnabled = function() return Free.enabled end,
SetSpeed = function(v) Free.speed = v end,
SetSprintMult = function(v) Free.sprintMult = v end,
SetSensitivity = function(v) Free.sensitivity = v end
}
end
-- ========== загрузка конфигурации ==========
pcall(function()
Rayfield:LoadConfiguration()
task.defer(function()
applyVisualToAll()
rescanHeads()
end)
end)