local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Window = Rayfield:CreateWindow({ Name = "Surroundings Viewer", LoadingTitle = "Loading Viewer...", LoadingSubtitle = "Optimized Viewport", ConfigurationSaving = { Enabled = false } }) local MainTab = Window:CreateTab("Main", 4483362458) local EffectsTab = Window:CreateTab("Special Effects", 4483345998) local GeneralTab = Window:CreateTab("General Needs", 4483362458) -- ═══════════════ Services ═══════════════ local Players = game:GetService("Players") local RunService = game:GetService("RunService") local Lighting = game:GetService("Lighting") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") local Camera = workspace.CurrentCamera local guiParent = (gethui and gethui()) or game:GetService("CoreGui") -- ═══════════════ State ═══════════════ local isEnabled = false local autoLoopEnabled = false local autoLoopToken = 0 local fullscreenLocked = false local espEnabled = false local crosshairEnabled = false local crosshairSize = 16 local crosshairColor = Color3.fromRGB(255, 255, 255) local renderConn = nil local trackedPlayers = {} local refreshingMap = false local MapFolder, PlayersFolder local stopPulling -- assigned in the Pulling Service section local stopFlick -- assigned in the Flick Shoot section local stopFullbright -- assigned in the Fullbright section local liveEnabled = false -- live unanchored blocks local liveParts = {} local liveConn = nil local AutoToggle -- Rayfield toggle (forward declared so the on-screen button can sync it) local OFFSCREEN = CFrame.new(0, -5000, 0) local espColor = Color3.fromRGB(255, 40, 40) local RED = BrickColor.new(espColor) -- connection bookkeeping so Unload can clean everything local conns = {} local function bind(signal, fn) local c = signal:Connect(fn) table.insert(conns, c) return c end -- ═══════════════ Viewer UI ═══════════════ local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "SurroundingsViewportUI" ScreenGui.ResetOnSpawn = false ScreenGui.DisplayOrder = 999999 ScreenGui.Enabled = false ScreenGui.Parent = guiParent local MainFrame = Instance.new("Frame") MainFrame.Size = UDim2.new(0, 260, 0, 180) MainFrame.Position = UDim2.new(0.5, -130, 0.5, -90) MainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 25) MainFrame.BorderSizePixel = 2 MainFrame.BorderColor3 = Color3.fromRGB(255, 200, 0) MainFrame.Parent = ScreenGui local TopBar = Instance.new("TextLabel") TopBar.Size = UDim2.new(1, 0, 0, 24) TopBar.BackgroundColor3 = Color3.fromRGB(30, 30, 35) TopBar.Text = " Surroundings" TopBar.TextColor3 = Color3.fromRGB(255, 255, 255) TopBar.TextXAlignment = Enum.TextXAlignment.Left TopBar.Font = Enum.Font.SourceSansBold TopBar.TextSize = 14 TopBar.ZIndex = 2 TopBar.Parent = MainFrame local RefreshButton = Instance.new("TextButton") RefreshButton.Size = UDim2.new(0, 22, 0, 22) RefreshButton.Position = UDim2.new(1, -23, 0, 1) RefreshButton.BackgroundColor3 = Color3.fromRGB(255, 200, 0) RefreshButton.Text = "🔄" RefreshButton.TextColor3 = Color3.fromRGB(0, 0, 0) RefreshButton.TextSize = 14 RefreshButton.ZIndex = 20 RefreshButton.Parent = MainFrame local LoopButton = Instance.new("TextButton") LoopButton.Size = UDim2.new(0, 22, 0, 22) LoopButton.Position = UDim2.new(1, -47, 0, 1) LoopButton.BackgroundColor3 = Color3.fromRGB(70, 70, 80) LoopButton.Text = "⏱️" LoopButton.TextColor3 = Color3.fromRGB(255, 255, 255) LoopButton.TextSize = 14 LoopButton.ZIndex = 20 LoopButton.Parent = MainFrame local Viewport = Instance.new("ViewportFrame") Viewport.Size = UDim2.new(1, 0, 1, -24) Viewport.Position = UDim2.new(0, 0, 0, 24) Viewport.BackgroundColor3 = Color3.fromRGB(135, 206, 235) Viewport.Ambient = Lighting.Ambient Viewport.LightColor = Lighting.OutdoorAmbient Viewport.LightDirection = Vector3.new(-1, -1, -1) Viewport.ZIndex = 1 Viewport.Parent = MainFrame local NameOverlay = Instance.new("Frame") NameOverlay.Name = "NameOverlay" NameOverlay.Size = UDim2.new(1, 0, 1, -24) NameOverlay.Position = UDim2.new(0, 0, 0, 24) NameOverlay.BackgroundTransparency = 1 NameOverlay.ClipsDescendants = true NameOverlay.ZIndex = 5 NameOverlay.Parent = MainFrame local WorldModel = Instance.new("WorldModel") WorldModel.Parent = Viewport local ViewportCam = Instance.new("Camera") ViewportCam.Parent = Viewport Viewport.CurrentCamera = ViewportCam local ResizeHandle = Instance.new("TextButton") ResizeHandle.Size = UDim2.new(0, 22, 0, 22) ResizeHandle.Position = UDim2.new(1, -22, 1, -22) ResizeHandle.BackgroundColor3 = Color3.fromRGB(255, 200, 0) ResizeHandle.Text = "↘" ResizeHandle.TextColor3 = Color3.fromRGB(0, 0, 0) ResizeHandle.TextSize = 16 ResizeHandle.ZIndex = 10 ResizeHandle.Parent = MainFrame -- ═══════════════ Crosshair UI ═══════════════ local CrossGui = Instance.new("ScreenGui") CrossGui.Name = "CrosshairUI" CrossGui.ResetOnSpawn = false CrossGui.IgnoreGuiInset = true CrossGui.DisplayOrder = 1000000 CrossGui.Enabled = false CrossGui.Parent = guiParent local function makeBar(parent) local f = Instance.new("Frame") f.AnchorPoint = Vector2.new(0.5, 0.5) f.Position = UDim2.new(0.5, 0, 0.5, 0) f.BorderSizePixel = 0 f.BackgroundColor3 = crosshairColor f.Parent = parent local s = Instance.new("UIStroke") s.Thickness = 1 s.Color = Color3.new(0, 0, 0) s.Parent = f return f end local hBar, vBar = makeBar(CrossGui), makeBar(CrossGui) -- screen-center copy local vhBar, vvBar = makeBar(NameOverlay), makeBar(NameOverlay) -- copy INSIDE the viewer window vhBar.ZIndex = 8 vvBar.ZIndex = 8 vhBar.Visible = false vvBar.Visible = false -- remove only the name tags (the viewer crosshair lives in the same frame) local function clearNameTags() for _, c in ipairs(NameOverlay:GetChildren()) do if c:IsA("TextLabel") then c:Destroy() end end end -- Viewer open -> crosshair is drawn in the middle of the viewer window -- Viewer closed -> crosshair falls back to the middle of the screen local function updateCrosshair() for _, b in ipairs({hBar, vhBar}) do b.Size = UDim2.new(0, crosshairSize, 0, 2) b.BackgroundColor3 = crosshairColor end for _, b in ipairs({vBar, vvBar}) do b.Size = UDim2.new(0, 2, 0, crosshairSize) b.BackgroundColor3 = crosshairColor end local inViewer = crosshairEnabled and isEnabled CrossGui.Enabled = crosshairEnabled and not isEnabled vhBar.Visible = inViewer vvBar.Visible = inViewer end updateCrosshair() -- ═══════════════ Drag / Resize (multi-touch safe) ═══════════════ -- Only the finger/mouse that STARTED the drag controls it, so using the -- movement joystick with another finger no longer cancels it. local activeInput, activeMode, startPointer, startPos, startSize local function isPointer(input) return input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch end bind(TopBar.InputBegan, function(input) if fullscreenLocked or activeInput or not isPointer(input) then return end activeInput, activeMode = input, "drag" startPointer = input.Position startPos = MainFrame.Position end) bind(ResizeHandle.InputBegan, function(input) if fullscreenLocked or activeInput or not isPointer(input) then return end activeInput, activeMode = input, "resize" startPointer = input.Position startSize = MainFrame.Size end) bind(UserInputService.InputChanged, function(input) if not activeInput then return end local valid = (input == activeInput) or (activeInput.UserInputType == Enum.UserInputType.MouseButton1 and input.UserInputType == Enum.UserInputType.MouseMovement) if not valid then return end local delta = input.Position - startPointer if activeMode == "drag" then MainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) elseif activeMode == "resize" then MainFrame.Size = UDim2.new(0, math.max(140, startSize.X.Offset + delta.X), 0, math.max(100, startSize.Y.Offset + delta.Y)) end end) bind(UserInputService.InputEnded, function(input) if not activeInput then return end if input == activeInput or (activeInput.UserInputType == Enum.UserInputType.MouseButton1 and input.UserInputType == Enum.UserInputType.MouseButton1) then activeInput, activeMode = nil, nil end end) -- ═══════════════ Dummy builder ═══════════════ local function createDummy(playerName, isSelf) local model = Instance.new("Model") model.Name = "DummyVisual_" .. playerName local function newPart(name, size, color) local p = Instance.new("Part") p.Name = name p.Size = size p.BrickColor = color p.CanCollide = false p.CanTouch = false p.CanQuery = false p.Massless = true p.Anchored = false p.TopSurface = Enum.SurfaceType.Smooth p.BottomSurface = Enum.SurfaceType.Smooth p.Parent = model return p end local baseColor = isSelf and BrickColor.new("Bright green") or BrickColor.new("Bright blue") local hrp = newPart("HumanoidRootPart", Vector3.new(2, 2, 1), baseColor) hrp.Transparency = 1 hrp.Anchored = true model.PrimaryPart = hrp local torso = newPart("Torso", Vector3.new(2, 2, 1), baseColor) local head = newPart("Head", Vector3.new(1, 1, 1), BrickColor.new("Bright yellow")) local leftArm = newPart("Left Arm", Vector3.new(1, 2, 1), baseColor) local rightArm = newPart("Right Arm", Vector3.new(1, 2, 1), baseColor) local leftLeg = newPart("Left Leg", Vector3.new(1, 2, 1), BrickColor.new("Dark grey")) local rightLeg = newPart("Right Leg", Vector3.new(1, 2, 1), BrickColor.new("Dark grey")) local function weld(p0, p1, offset) p1.CFrame = p0.CFrame * offset local w = Instance.new("WeldConstraint") w.Part0 = p0 w.Part1 = p1 w.Parent = p0 end weld(hrp, torso, CFrame.new()) weld(torso, head, CFrame.new(0, 1.5, 0)) local function makeJoint(name, part0, part1, c0, c1) part1.CFrame = part0.CFrame * c0 * c1:Inverse() -- start in the correct pose local m = Instance.new("Motor6D") m.Name = name m.Part0 = part0 m.Part1 = part1 m.C0 = c0 m.C1 = c1 m.Parent = part0 return m end local joints = { LeftShoulder = makeJoint("LeftShoulder", torso, leftArm, CFrame.new(-1.5, 0.5, 0), CFrame.new(0, 0.5, 0)), RightShoulder = makeJoint("RightShoulder", torso, rightArm, CFrame.new(1.5, 0.5, 0), CFrame.new(0, 0.5, 0)), LeftHip = makeJoint("LeftHip", torso, leftLeg, CFrame.new(-0.5, -1, 0), CFrame.new(0, 1, 0)), RightHip = makeJoint("RightHip", torso, rightLeg, CFrame.new(0.5, -1, 0), CFrame.new(0, 1, 0)), } local nameLabel = Instance.new("TextLabel") nameLabel.Name = "Tag_" .. playerName nameLabel.Size = UDim2.new(0, 140, 0, 20) nameLabel.AnchorPoint = Vector2.new(0.5, 1) nameLabel.BackgroundTransparency = 1 nameLabel.Text = playerName nameLabel.TextColor3 = isSelf and Color3.fromRGB(140, 255, 140) or Color3.fromRGB(255, 255, 255) nameLabel.TextStrokeTransparency = 0.35 nameLabel.Font = Enum.Font.SourceSansBold nameLabel.TextSize = 13 nameLabel.Visible = false nameLabel.Parent = NameOverlay return model, nameLabel, joints, {Torso = torso, LeftArm = leftArm, RightArm = rightArm}, baseColor end -- ═══════════════ Held tool (lightweight + welded to hand) ═══════════════ -- Old version cloned the entire Tool (scripts, sounds, particles...) and left it -- floating. Now we clone only the visual parts, strip everything else, and weld -- the handle to the right arm. It only rebuilds when the equipped tool CHANGES. local KEEP = { SpecialMesh = true, BlockMesh = true, CylinderMesh = true, FileMesh = true, Decal = true, Texture = true, SurfaceAppearance = true, } local function buildToolVisual(tool, arm) local handle = tool:FindFirstChild("Handle") if not (handle and handle:IsA("BasePart")) then return nil end local holder = Instance.new("Model") holder.Name = "HeldTool" local clones = {} for _, d in ipairs(tool:GetDescendants()) do if d:IsA("BasePart") then local c = d:Clone() for _, ch in ipairs(c:GetChildren()) do if not KEEP[ch.ClassName] then ch:Destroy() end end c.Anchored = false c.CanCollide = false c.CanTouch = false c.CanQuery = false c.Massless = true c.Parent = holder clones[d] = c end end local handleClone = clones[handle] if not handleClone then holder:Destroy() return nil end for real, c in pairs(clones) do if real ~= handle then local w = Instance.new("Weld") w.Part0 = handleClone w.Part1 = c w.C0 = handle.CFrame:ToObjectSpace(real.CFrame) w.Parent = c end end local c0 = CFrame.new(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0) -- standard R6 RightGrip handleClone.CFrame = arm.CFrame * c0 * tool.Grip:Inverse() local grip = Instance.new("Weld") grip.Name = "RightGrip" grip.Part0 = arm grip.Part1 = handleClone grip.C0 = c0 grip.C1 = tool.Grip grip.Parent = handleClone return holder end local function updateTool(player, data) local char = player.Character local tool = char and char:FindFirstChildOfClass("Tool") or nil if tool == data.ToolSource then return end if data.ToolVisual then data.ToolVisual:Destroy() data.ToolVisual = nil end data.ToolSource = tool if tool then local visual = buildToolVisual(tool, data.Limbs.RightArm) if visual then visual.Parent = data.Model data.ToolVisual = visual end end end -- ═══════════════ Tracking ═══════════════ local function untrackPlayer(player) local data = trackedPlayers[player] if not data then return end if data.Model then data.Model:Destroy() end if data.NameLabel then data.NameLabel:Destroy() end trackedPlayers[player] = nil end local function trackPlayer(player) untrackPlayer(player) local isSelf = (player == LocalPlayer) local dummy, nameLabel, joints, limbs, baseColor = createDummy(player.Name, isSelf) dummy.Parent = PlayersFolder or WorldModel trackedPlayers[player] = { Model = dummy, NameLabel = nameLabel, Joints = joints, Limbs = limbs, BaseColor = baseColor, Color = baseColor, IsSelf = isSelf, Phase = math.random() * 6, Speed = 0, IdleTime = 0, Settled = true, NextToolCheck = 0, ToolSource = nil, ToolVisual = nil, } end -- ═══════ Live unanchored blocks (helpers) ═══════ local MAX_LIVE = 1500 -- keeps the nearest N moving parts so big maps don't lag -- pairs every unanchored "assembly root" part of the real model with its clone local function collectLive(real, clone, out) local function consider(r, c) if r:IsA("BasePart") and c:IsA("BasePart") and not r.Anchored and r.AssemblyRootPart == r then table.insert(out, {real = r, clone = c, last = r.CFrame}) end end consider(real, clone) local rd, cd = real:GetDescendants(), clone:GetDescendants() for i = 1, #rd do local r, c = rd[i], cd[i] if not c or r.ClassName ~= c.ClassName or r.Name ~= c.Name then break end consider(r, c) if i % 2000 == 0 then task.wait() end end end local function trimLive(list) if #list <= MAX_LIVE then return end local camPos = Camera.CFrame.Position table.sort(list, function(a, b) return (a.last.Position - camPos).Magnitude < (b.last.Position - camPos).Magnitude end) for i = #list, MAX_LIVE + 1, -1 do list[i] = nil end end -- Map refresh now runs in small chunks (yielding) so it doesn't freeze the -- game, and the new copy replaces the old one only when it's finished (no flicker). local function refreshMap() if refreshingMap or not isEnabled then return end refreshingMap = true task.spawn(function() local newFolder = Instance.new("Folder") newFolder.Name = "Map" local newLive = {} local count = 0 for _, child in ipairs(workspace:GetChildren()) do if not isEnabled then break end local okClass = child:IsA("Model") or child:IsA("Folder") or child:IsA("Tool") or (child:IsA("BasePart") and not child:IsA("Terrain")) if okClass and child ~= Camera and not Players:GetPlayerFromCharacter(child) then local ok, clone = pcall(child.Clone, child) if ok and clone then clone.Parent = newFolder if liveEnabled then pcall(collectLive, child, clone, newLive) end end count += 1 if count % 12 == 0 then task.wait() end end end if isEnabled then if MapFolder then MapFolder:Destroy() end newFolder.Parent = WorldModel MapFolder = newFolder if liveEnabled then trimLive(newLive) end liveParts = liveEnabled and newLive or {} else newFolder:Destroy() end refreshingMap = false end) end local function refreshPlayers() local active = {} for _, player in ipairs(Players:GetPlayers()) do active[player] = true if not trackedPlayers[player] then trackPlayer(player) end end for player in pairs(trackedPlayers) do if not active[player] then untrackPlayer(player) end end end -- ═══════════════ Projection (matches the viewport's own aspect ratio) ═══════════════ local function projectToViewport(worldPos, camCF, fov, size) if size.X <= 0 or size.Y <= 0 then return nil end local rel = camCF:PointToObjectSpace(worldPos) if rel.Z >= -0.1 then return nil end local t = math.tan(math.rad(fov) / 2) local nx = rel.X / (-rel.Z * t * (size.X / size.Y)) local ny = rel.Y / (-rel.Z * t) if math.abs(nx) > 1.15 or math.abs(ny) > 1.15 then return nil end return Vector2.new((nx * 0.5 + 0.5) * size.X, (0.5 - ny * 0.5) * size.Y) end -- ═══════════════ Viewer start / stop ═══════════════ local function startViewer() if renderConn then renderConn:Disconnect() renderConn = nil end WorldModel:ClearAllChildren() clearNameTags() table.clear(trackedPlayers) MapFolder = nil PlayersFolder = Instance.new("Folder") PlayersFolder.Name = "Players" PlayersFolder.Parent = WorldModel refreshMap() for _, player in ipairs(Players:GetPlayers()) do trackPlayer(player) end renderConn = RunService.RenderStepped:Connect(function(dt) Camera = workspace.CurrentCamera or Camera local camCF = Camera.CFrame local camPos = camCF.Position local fov = Camera.FieldOfView ViewportCam.CFrame = camCF ViewportCam.FieldOfView = fov local overlaySize = NameOverlay.AbsoluteSize local now = os.clock() for player, data in pairs(trackedPlayers) do local model = data.Model local char = player.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not (model and model.Parent) then data.NameLabel.Visible = false continue end if not hrp then model:PivotTo(OFFSCREEN) data.NameLabel.Visible = false continue end -- hide our own dummy in first person if data.IsSelf then local head = char:FindFirstChild("Head") if head and (camPos - head.Position).Magnitude < 1.8 then model:PivotTo(OFFSCREEN) data.NameLabel.Visible = false continue end end model:PivotTo(hrp.CFrame) local distance = (camPos - hrp.Position).Magnitude -- ESP colour (only touched when it actually changes) local want = (espEnabled and not data.IsSelf) and RED or data.BaseColor if data.Color ~= want then data.Color = want data.Limbs.Torso.BrickColor = want data.Limbs.LeftArm.BrickColor = want data.Limbs.RightArm.BrickColor = want end -- Walk animation: accumulated phase + smoothed speed (no more jitter / hyper-speed) if distance <= 150 then local vel = hrp.AssemblyLinearVelocity local target = math.min(Vector3.new(vel.X, 0, vel.Z).Magnitude, 40) data.Speed += (target - data.Speed) * math.min(1, dt * 10) local j = data.Joints if data.Speed > 1 then data.Settled = false data.IdleTime = 0 data.Phase += dt * math.clamp(data.Speed * 0.5, 3, 9) -- ~8 rad/s at normal walk speed local amp = math.clamp(data.Speed / 16, 0.3, 1) * 0.7 local angle = math.sin(data.Phase) * amp j.LeftShoulder.Transform = CFrame.Angles(angle, 0, 0) j.RightShoulder.Transform = CFrame.Angles(-angle, 0, 0) j.LeftHip.Transform = CFrame.Angles(-angle, 0, 0) j.RightHip.Transform = CFrame.Angles(angle, 0, 0) elseif not data.Settled then data.IdleTime += dt local a = math.min(1, dt * 12) j.LeftShoulder.Transform = j.LeftShoulder.Transform:Lerp(CFrame.new(), a) j.RightShoulder.Transform = j.RightShoulder.Transform:Lerp(CFrame.new(), a) j.LeftHip.Transform = j.LeftHip.Transform:Lerp(CFrame.new(), a) j.RightHip.Transform = j.RightHip.Transform:Lerp(CFrame.new(), a) if data.IdleTime > 0.6 then j.LeftShoulder.Transform = CFrame.new() j.RightShoulder.Transform = CFrame.new() j.LeftHip.Transform = CFrame.new() j.RightHip.Transform = CFrame.new() data.Settled = true end end end -- Name tag (40 studs) if distance <= 40 and not data.IsSelf then local p = projectToViewport(hrp.Position + Vector3.new(0, 3.2, 0), camCF, fov, overlaySize) if p then data.NameLabel.Position = UDim2.fromOffset(p.X, p.Y) data.NameLabel.Visible = true else data.NameLabel.Visible = false end else data.NameLabel.Visible = false end -- Held tool: checked ~4x/sec, rebuilt only when it changes if now >= data.NextToolCheck then data.NextToolCheck = now + 0.25 + math.random() * 0.1 updateTool(player, data) end end end) end local function stopViewer() if renderConn then renderConn:Disconnect() renderConn = nil end WorldModel:ClearAllChildren() clearNameTags() table.clear(trackedPlayers) MapFolder, PlayersFolder = nil, nil liveParts = {} end bind(Players.PlayerAdded, function(player) if isEnabled then trackPlayer(player) end end) bind(Players.PlayerRemoving, function(player) untrackPlayer(player) end) -- ═══════════════ Live unanchored blocks ═══════════════ -- Moving blocks / dropped items are mirrored into the viewer ~20x per second. -- Blocks that appear AFTER the last map refresh are picked up by the next refresh -- (use the refresh button or Auto Refresh). local function startLive() if liveConn then return end local acc = 0 liveConn = RunService.Heartbeat:Connect(function(dt) acc += dt if acc < 0.05 then return end acc = 0 for i = #liveParts, 1, -1 do local item = liveParts[i] local real, clone = item.real, item.clone if not real.Parent then -- block was deleted in the real world liveParts[i] = liveParts[#liveParts] liveParts[#liveParts] = nil if clone.Parent then clone:Destroy() end elseif not clone.Parent then liveParts[i] = liveParts[#liveParts] liveParts[#liveParts] = nil else local cf = real.CFrame if cf ~= item.last then item.last = cf clone.CFrame = cf end end end end) end local function stopLive() if liveConn then liveConn:Disconnect() liveConn = nil end liveParts = {} end -- ═══════════════ Auto refresh ═══════════════ local function setAutoLoop(state) if autoLoopEnabled == state then return end autoLoopEnabled = state autoLoopToken += 1 LoopButton.BackgroundColor3 = state and Color3.fromRGB(46, 204, 113) or Color3.fromRGB(70, 70, 80) if AutoToggle then pcall(function() AutoToggle:Set(state) end) end if state then local token = autoLoopToken task.spawn(function() while autoLoopEnabled and token == autoLoopToken do task.wait(3) if autoLoopEnabled and token == autoLoopToken and isEnabled then refreshPlayers() refreshMap() end end end) end end bind(RefreshButton.MouseButton1Click, function() if isEnabled then refreshMap() refreshPlayers() end end) bind(LoopButton.MouseButton1Click, function() setAutoLoop(not autoLoopEnabled) end) -- ═══════════════ Fullscreen lock ═══════════════ -- Fix: the viewer now lives in PlayerGui at a very LOW DisplayOrder while in -- fullscreen, so Roblox's own UI (joystick, jump button, chat, hotbar, menu) and -- the game's GUIs draw ON TOP of it instead of being blocked. Refresh/auto buttons -- stay visible (moved below the top bar) and are also duplicated in the Rayfield tab. local function setFullscreen(on) fullscreenLocked = on activeInput, activeMode = nil, nil if on then pcall(function() ScreenGui.Parent = PlayerGui end) ScreenGui.IgnoreGuiInset = true ScreenGui.DisplayOrder = -10000 MainFrame.Size = UDim2.new(1, 0, 1, 0) MainFrame.Position = UDim2.new(0, 0, 0, 0) MainFrame.Active = false -- touches/clicks pass straight through TopBar.Visible = false ResizeHandle.Visible = false Viewport.Size = UDim2.new(1, 0, 1, 0) Viewport.Position = UDim2.new(0, 0, 0, 0) NameOverlay.Size = UDim2.new(1, 0, 1, 0) NameOverlay.Position = UDim2.new(0, 0, 0, 0) RefreshButton.Position = UDim2.new(1, -30, 0, 46) LoopButton.Position = UDim2.new(1, -56, 0, 46) RefreshButton.BackgroundTransparency = 0.35 LoopButton.BackgroundTransparency = 0.35 else ScreenGui.Parent = guiParent ScreenGui.IgnoreGuiInset = false ScreenGui.DisplayOrder = 999999 MainFrame.Size = UDim2.new(0, 260, 0, 180) MainFrame.Position = UDim2.new(0.5, -130, 0.5, -90) MainFrame.Active = true TopBar.Visible = true ResizeHandle.Visible = true Viewport.Size = UDim2.new(1, 0, 1, -24) Viewport.Position = UDim2.new(0, 0, 0, 24) NameOverlay.Size = UDim2.new(1, 0, 1, -24) NameOverlay.Position = UDim2.new(0, 0, 0, 24) RefreshButton.Position = UDim2.new(1, -23, 0, 1) LoopButton.Position = UDim2.new(1, -47, 0, 1) RefreshButton.BackgroundTransparency = 0 LoopButton.BackgroundTransparency = 0 end end -- ═══════════════ Real ESP Highlight ═══════════════ -- Real Roblox Highlight on every other player's actual character: -- coloured fill + white outline, visible through walls. -- (Roblox only renders ~31 highlights at once, so the closest players win.) local ESPFolder = Instance.new("Folder") ESPFolder.Name = "ESPHighlights" ESPFolder.Parent = guiParent local espHighlights = {} local espToken = 0 local function clearESP() for _, h in pairs(espHighlights) do h:Destroy() end table.clear(espHighlights) end local function syncESP() for _, plr in ipairs(Players:GetPlayers()) do if plr ~= LocalPlayer then local char = plr.Character local h = espHighlights[plr] if char then if not h then h = Instance.new("Highlight") h.Name = plr.Name h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.FillTransparency = 0.5 h.OutlineTransparency = 0 h.OutlineColor = Color3.new(1, 1, 1) h.Parent = ESPFolder espHighlights[plr] = h end h.FillColor = espColor if h.Adornee ~= char then h.Adornee = char end elseif h then h:Destroy() espHighlights[plr] = nil end end end for plr, h in pairs(espHighlights) do if not plr.Parent then h:Destroy() espHighlights[plr] = nil end end end local function setESP(on) espEnabled = on espToken += 1 if on then local token = espToken task.spawn(function() while espEnabled and token == espToken do syncESP() task.wait(0.5) end end) else clearESP() end end -- ═══════════════ Unload ═══════════════ local function unload() autoLoopEnabled = false autoLoopToken += 1 isEnabled = false espEnabled = false espToken += 1 clearESP() ESPFolder:Destroy() if stopPulling then stopPulling() end if stopFlick then stopFlick() end if stopFullbright then stopFullbright() end stopLive() stopViewer() for _, c in ipairs(conns) do pcall(function() c:Disconnect() end) end table.clear(conns) ScreenGui:Destroy() CrossGui:Destroy() pcall(function() Rayfield:Destroy() end) end -- ═══════════════ Rayfield: Main tab ═══════════════ MainTab:CreateToggle({ Name = "Surroundings Window (Anti-Blind)", CurrentValue = false, Flag = "AntiBlindToggle", Callback = function(Value) isEnabled = Value ScreenGui.Enabled = Value if Value then startViewer() else stopViewer() end updateCrosshair() end, }) MainTab:CreateToggle({ Name = "Fullscreen Lock Mode", CurrentValue = false, Flag = "FullscreenLockToggle", Callback = function(Value) setFullscreen(Value) end, }) MainTab:CreateButton({ Name = "Refresh Map + Players", Callback = function() if isEnabled then refreshMap() refreshPlayers() end end, }) AutoToggle = MainTab:CreateToggle({ Name = "Auto Refresh (every 3s)", CurrentValue = false, Flag = "AutoRefreshToggle", Callback = function(Value) setAutoLoop(Value) end, }) MainTab:CreateToggle({ Name = "Crosshair (+)", CurrentValue = false, Flag = "CrosshairToggle", Callback = function(Value) crosshairEnabled = Value updateCrosshair() end, }) MainTab:CreateSlider({ Name = "Crosshair Size", Range = {6, 60}, Increment = 1, Suffix = "px", CurrentValue = crosshairSize, Flag = "CrosshairSize", Callback = function(Value) crosshairSize = Value updateCrosshair() end, }) MainTab:CreateColorPicker({ Name = "Crosshair Color", Color = crosshairColor, Flag = "CrosshairColor", Callback = function(Value) crosshairColor = Value updateCrosshair() end, }) MainTab:CreateToggle({ Name = "Live Unanchored Blocks", CurrentValue = false, Flag = "LiveBlocks", Callback = function(Value) liveEnabled = Value if Value then startLive() if isEnabled then task.spawn(function() while refreshingMap do task.wait(0.1) end refreshMap() -- rebuild the map so every unanchored block gets tracked end) end else stopLive() end end, }) MainTab:CreateButton({ Name = "Unload Script", Callback = unload, }) -- ═══════════════ Rayfield: Special Effects tab ═══════════════ EffectsTab:CreateToggle({ Name = "ESP Highlight", CurrentValue = false, Flag = "ESPToggle", Callback = function(Value) setESP(Value) end, }) EffectsTab:CreateColorPicker({ Name = "ESP Color", Color = espColor, Flag = "ESPColor", Callback = function(Value) espColor = Value RED = BrickColor.new(Value) if espEnabled then syncESP() end end, }) -- ═══════════════ Rayfield: General Needs tab ═══════════════ -- "Who has What": scans every player (by DISPLAY NAME / nickname) and writes -- the tools they have into the text below. No notifications. local WhoParagraph = GeneralTab:CreateParagraph({ Title = "Who has What", Content = "Press the button to scan.", }) local function scanWhoHasWhat() local players = Players:GetPlayers() table.sort(players, function(a, b) return a.DisplayName:lower() < b.DisplayName:lower() end) local lines = {} for _, plr in ipairs(players) do local counts, order = {}, {} local function addTool(tool) if tool:IsA("Tool") then if not counts[tool.Name] then counts[tool.Name] = 0 table.insert(order, tool.Name) end counts[tool.Name] += 1 end end local char = plr.Character if char then for _, child in ipairs(char:GetChildren()) do addTool(child) end end local backpack = plr:FindFirstChildOfClass("Backpack") if backpack then for _, child in ipairs(backpack:GetChildren()) do addTool(child) end end if #order > 0 then local parts = {} for _, name in ipairs(order) do table.insert(parts, counts[name] > 1 and (name .. " x" .. counts[name]) or name) end table.insert(lines, plr.DisplayName .. ": " .. table.concat(parts, ", ")) end end WhoParagraph:Set({ Title = "Who has What (" .. #players .. " players)", Content = #lines > 0 and table.concat(lines, "\n") or "Nobody has any tools.", }) end GeneralTab:CreateButton({ Name = "Who has What", Callback = scanWhoHasWhat, }) -- ═══════════════ Rayfield: Pulling Service ═══════════════ -- Someone says "Pull" in chat -> equip GetOverHere, fire the remote on THAT -- player, unequip, then 16s cooldown (anything said during it is ignored). -- Chat arrives through events; a Heartbeat loop runs the equip/fire/unequip -- sequence, the cooldown and the status text. local TextChatService = game:GetService("TextChatService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local PULL_NAME = "GetOverHere" -- tool name AND remote name local PULL_COOLDOWN = 16 -- seconds local EQUIP_DELAY = 0.25 -- wait after equipping before firing local FIRE_DELAY = 0.2 -- wait after firing before unequipping local pullingEnabled = false local wallCheckEnabled = false local pullState = "idle" -- idle -> equip -> unequip -> idle local pullTarget = nil local stateTime = 0 local cooldownEnd = 0 local pullNote = "" local pullStatusShown = nil local pullConns = {} local PullStatus = GeneralTab:CreateParagraph({ Title = "Pulling Service", Content = "Off", }) local function getPullTool() local char = LocalPlayer.Character local tool = char and char:FindFirstChild(PULL_NAME) if not tool then local backpack = LocalPlayer:FindFirstChildOfClass("Backpack") tool = backpack and backpack:FindFirstChild(PULL_NAME) end if tool and tool:IsA("Tool") then return tool end return nil end -- true = nothing solid between you and the target (player bodies and -- non-collidable parts don't count as walls) local function hasLineOfSight(myChar, targetChar) local tHRP = targetChar:FindFirstChild("HumanoidRootPart") local origin = myChar:FindFirstChild("Head") or myChar:FindFirstChild("HumanoidRootPart") if not (tHRP and origin) then return false end local ignore = {} for _, p in ipairs(Players:GetPlayers()) do if p.Character then table.insert(ignore, p.Character) end end local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = ignore params.RespectCanCollide = true return workspace:Raycast(origin.Position, tHRP.Position - origin.Position, params) == nil end local function faceTarget(hrp, tHRP) local flat = Vector3.new(tHRP.Position.X, hrp.Position.Y, tHRP.Position.Z) if (flat - hrp.Position).Magnitude > 0.1 then hrp.CFrame = CFrame.lookAt(hrp.Position, flat) end end local function finishPull(startCooldown) local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then pcall(function() hum:UnequipTools() end) end pullState = "idle" pullTarget = nil if startCooldown then cooldownEnd = os.clock() + PULL_COOLDOWN end end local function beginPull(plr) local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local hrp = char and char:FindFirstChild("HumanoidRootPart") local tChar = plr.Character local tHRP = tChar and tChar:FindFirstChild("HumanoidRootPart") if not (hum and hrp and hum.Health > 0 and tChar and tHRP) then return end local tool = getPullTool() if not tool then pullNote = "No '" .. PULL_NAME .. "' tool found" return end if not ReplicatedStorage:FindFirstChild(PULL_NAME) then pullNote = "Remote '" .. PULL_NAME .. "' not found" return end if wallCheckEnabled then if not hasLineOfSight(char, tChar) then pullNote = "Ignored " .. plr.DisplayName .. " (wall in the way)" return -- no cooldown for a blocked pull end faceTarget(hrp, tHRP) end pullTarget = plr pullState = "equip" stateTime = os.clock() + EQUIP_DELAY pullNote = "" hum:EquipTool(tool) end local function onPullChat(plr, text) if not pullingEnabled or plr == LocalPlayer or type(text) ~= "string" then return end local clean = text:lower():gsub("[%s%p]", "") -- "Pull", "pull!", " PULL " all count if clean ~= "pull" then return end if pullState ~= "idle" or os.clock() < cooldownEnd then return end -- cooldown / busy: ignored beginPull(plr) end local function pullStatusText() if not pullingEnabled then return "Off" end if pullState ~= "idle" then return "Pulling " .. (pullTarget and pullTarget.DisplayName or "?") .. "..." end local left = cooldownEnd - os.clock() if left > 0 then return string.format("Cooldown: %ds", math.ceil(left)) end if pullNote ~= "" then return "Ready • " .. pullNote end return 'Ready - waiting for someone to say "Pull"' end local function startPulling() pullingEnabled = true pullStatusShown = nil -- new chat pcall(function() table.insert(pullConns, TextChatService.MessageReceived:Connect(function(msg) local src = msg.TextSource if not src then return end local plr = Players:GetPlayerByUserId(src.UserId) if plr then onPullChat(plr, msg.Text) end end)) end) -- legacy chat (double triggers are harmless: the 2nd one sees "busy" and is ignored) local function hookPlayer(plr) table.insert(pullConns, plr.Chatted:Connect(function(text) onPullChat(plr, text) end)) end for _, plr in ipairs(Players:GetPlayers()) do hookPlayer(plr) end table.insert(pullConns, Players.PlayerAdded:Connect(hookPlayer)) -- Heartbeat: sequence + cooldown + status table.insert(pullConns, RunService.Heartbeat:Connect(function() local now = os.clock() if pullState == "equip" and now >= stateTime then local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local hrp = char and char:FindFirstChild("HumanoidRootPart") local tChar = pullTarget and pullTarget.Character local tHRP = tChar and tChar:FindFirstChild("HumanoidRootPart") if not (hum and hrp and hum.Health > 0 and tChar and tHRP) then pullNote = "Target or you disappeared" finishPull(false) elseif wallCheckEnabled and not hasLineOfSight(char, tChar) then pullNote = "Ignored " .. pullTarget.DisplayName .. " (wall in the way)" finishPull(false) else if wallCheckEnabled then faceTarget(hrp, tHRP) end local remote = ReplicatedStorage:FindFirstChild(PULL_NAME) if remote then pcall(function() remote:FireServer(tChar) end) -- same as workspace[username] pullNote = "Last pull: " .. pullTarget.DisplayName else pullNote = "Remote '" .. PULL_NAME .. "' not found" end pullState = "unequip" stateTime = now + FIRE_DELAY end elseif pullState == "unequip" and now >= stateTime then finishPull(true) -- unequip + start the 16s cooldown end local text = pullStatusText() if text ~= pullStatusShown then pullStatusShown = text pcall(function() PullStatus:Set({Title = "Pulling Service", Content = text}) end) end end)) end stopPulling = function() pullingEnabled = false for _, c in ipairs(pullConns) do pcall(function() c:Disconnect() end) end table.clear(pullConns) if pullState ~= "idle" then finishPull(false) end pullStatusShown = nil pcall(function() PullStatus:Set({Title = "Pulling Service", Content = "Off"}) end) end GeneralTab:CreateToggle({ Name = "Pulling Service", CurrentValue = false, Flag = "PullingService", Callback = function(Value) if Value then startPulling() else stopPulling() end end, }) GeneralTab:CreateToggle({ Name = "Wall Check + Look at Target", CurrentValue = false, Flag = "PullWallCheckLook", Callback = function(Value) wallCheckEnabled = Value end, }) -- ═══════════════ Flick Shoot (built-in ability button) ═══════════════ -- Toggle on -> Roblox's built-in ability button (ContextActionService touch -- button) appears; X also works on PC. -- Press it -> camera snaps to the nearest player, TirFusil fires at them, -- camera snaps straight back. All in the same frame. local ContextActionService = game:GetService("ContextActionService") local FLICK_ACTION = "FlickShootAbility" local FLICK_KEY = Enum.KeyCode.X local SHOOT_REMOTE = "TirFusil" local AIM_PART = "Head" -- falls back to HumanoidRootPart local function nearestTargetChar(myHRP) local best, bestDist for _, plr in ipairs(Players:GetPlayers()) do if plr ~= LocalPlayer then local char = plr.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local hrp = char and char:FindFirstChild("HumanoidRootPart") if hum and hrp and hum.Health > 0 then local d = (hrp.Position - myHRP.Position).Magnitude if not bestDist or d < bestDist then best, bestDist = char, d end end end end return best end -- ═══ Shot prediction ═══ local Stats = game:GetService("Stats") local predictEnabled = false local bulletSpeed = 500 -- studs/second (slider) local leadStrength = 1.0 -- 1.0 = full lead (slider) local inheritMySpeed = false -- only if the bullet inherits YOUR velocity local function getPingSeconds() local ok, ms = pcall(function() return Stats.Network.ServerStatsItem["Data Ping"]:GetValue() end) return ((ok and ms) or 0) / 1000 end -- Where the target will be when the bullet gets there: -- lead time = your ping (you see them in the past) + bullet flight time local function predictAimPos(aim, targetChar, origin, myHRP) local tHRP = targetChar:FindFirstChild("HumanoidRootPart") or aim local vel = tHRP.AssemblyLinearVelocity vel = Vector3.new(vel.X, math.clamp(vel.Y, -60, 60), vel.Z) if inheritMySpeed then vel = vel - myHRP.AssemblyLinearVelocity end local latency = getPingSeconds() local lead = latency for _ = 1, 3 do -- flight time depends on where they'll be, so refine a few times local predicted = aim.Position + vel * lead lead = latency + (predicted - origin).Magnitude / bulletSpeed end lead = math.min(lead, 1.5) return aim.Position + vel * lead * leadStrength end local function flickShoot() local cam = workspace.CurrentCamera local char = LocalPlayer.Character local myHRP = char and char:FindFirstChild("HumanoidRootPart") local remote = ReplicatedStorage:FindFirstChild(SHOOT_REMOTE) if not (cam and myHRP and remote) then return end local targetChar = nearestTargetChar(myHRP) if not targetChar then return end local aim = targetChar:FindFirstChild(AIM_PART) or targetChar:FindFirstChild("HumanoidRootPart") if not aim then return end local origin = (char:FindFirstChild("Head") or myHRP).Position local aimPos = aim.Position if predictEnabled then aimPos = predictAimPos(aim, targetChar, origin, myHRP) end local direction = (aimPos - origin).Unit local original = cam.CFrame cam.CFrame = CFrame.lookAt(original.Position, aimPos) -- flick pcall(function() remote:FireServer(direction, nil) end) -- shoot cam.CFrame = original -- back to where you were end local flickBound = false local function startFlick() if flickBound then return end flickBound = true ContextActionService:BindAction(FLICK_ACTION, function(_, state) if state == Enum.UserInputState.Begin then flickShoot() end return Enum.ContextActionResult.Sink end, true, FLICK_KEY) ContextActionService:SetTitle(FLICK_ACTION, "Flick") end stopFlick = function() if not flickBound then return end flickBound = false pcall(function() ContextActionService:UnbindAction(FLICK_ACTION) end) end GeneralTab:CreateToggle({ Name = "Flick Shoot Button", CurrentValue = false, Flag = "FlickShootButton", Callback = function(Value) if Value then startFlick() else stopFlick() end end, }) GeneralTab:CreateToggle({ Name = "Predict Shots (lead the target)", CurrentValue = false, Flag = "PredictShots", Callback = function(Value) predictEnabled = Value end, }) GeneralTab:CreateSlider({ Name = "Bullet Speed", Range = {50, 2000}, Increment = 10, Suffix = " studs/s", CurrentValue = bulletSpeed, Flag = "BulletSpeed", Callback = function(Value) bulletSpeed = Value end, }) GeneralTab:CreateSlider({ Name = "Lead Strength", Range = {0, 200}, Increment = 5, Suffix = "%", CurrentValue = 100, Flag = "LeadStrength", Callback = function(Value) leadStrength = Value / 100 end, }) GeneralTab:CreateToggle({ Name = "Bullet Inherits My Speed", CurrentValue = false, Flag = "BulletInherits", Callback = function(Value) inheritMySpeed = Value end, }) -- ═══════════════ Fullbright (Special Effects tab) ═══════════════ -- Full daylight, no fog, no shadows, darkening/blur effects off. Re-applied -- every frame so games that keep changing the lighting can't undo it. -- Turning it off puts everything back the way it was. local FB_PROPS = { Brightness = 2, ClockTime = 14, FogStart = 0, FogEnd = 1000000, GlobalShadows = false, Ambient = Color3.fromRGB(178, 178, 178), OutdoorAmbient = Color3.fromRGB(178, 178, 178), ExposureCompensation = 0, } local fbSaved = {} local fbEffects = {} local fbConn = nil local function fbHandle(inst) if inst:IsA("BlurEffect") or inst:IsA("DepthOfFieldEffect") or inst:IsA("ColorCorrectionEffect") then if fbEffects[inst] == nil then fbEffects[inst] = inst.Enabled end if inst.Enabled then inst.Enabled = false end elseif inst:IsA("Atmosphere") then if fbEffects[inst] == nil then fbEffects[inst] = {inst.Density, inst.Haze} end if inst.Density ~= 0 then inst.Density = 0 end if inst.Haze ~= 0 then inst.Haze = 0 end end end local function startFullbright() if fbConn then return end fbSaved = {} fbEffects = {} for prop in pairs(FB_PROPS) do fbSaved[prop] = Lighting[prop] end local acc = 0.5 -- scan for effects right away, then twice a second fbConn = RunService.RenderStepped:Connect(function(dt) for prop, val in pairs(FB_PROPS) do if Lighting[prop] ~= val then Lighting[prop] = val end end acc += dt if acc >= 0.5 then acc = 0 for _, child in ipairs(Lighting:GetChildren()) do fbHandle(child) end end end) end stopFullbright = function() if not fbConn then return end fbConn:Disconnect() fbConn = nil for prop, val in pairs(fbSaved) do pcall(function() Lighting[prop] = val end) end for inst, v in pairs(fbEffects) do if inst.Parent then if type(v) == "table" then inst.Density, inst.Haze = v[1], v[2] else inst.Enabled = v end end end fbSaved, fbEffects = {}, {} end EffectsTab:CreateToggle({ Name = "Fullbright", CurrentValue = false, Flag = "Fullbright", Callback = function(Value) if Value then startFullbright() else stopFullbright() end end, })