Detailed Raycasting
Key RequiredUniversal

Detailed Raycasting

Universal ScriptISOXTERIAISOXTERIA 655 views 214 executesUpdated Apr 4, 2026
Unrated
00
Lua Script•203 lines (6963 chars)
-- ==============================================================================
-- ObsidianBox AI - DetailedCasting_PlayerHeadInfo (v2.5 Pro)
-- Script Type: LocalScript
-- Location: StarterPlayerScripts
-- Description: The ultimate real-time player data scraper & visualizer.
-- ==============================================================================

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

-- Configuration
local UPDATE_INTERVAL = 0.5

-- UI Configuration (Expanded to fit immense data payload)
local GUI_SIZE = UDim2.new(0, 320, 0, 240)
local STUDS_OFFSET = Vector3.new(0, 4.5, 0)

-- Global State
local isInfoVisible = true

-- ==============================================================================
-- TOGGLE UI SETUP (Obsidian Theme)
-- ==============================================================================
local playerGui = LocalPlayer:WaitForChild("PlayerGui")

local screenGui = Instance.new("ScreenGui")
screenGui.Name = "ObsidianInfoToggle"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui

local toggleButton = Instance.new("TextButton")
toggleButton.Name = "ToggleButton"
toggleButton.Size = UDim2.new(0, 150, 0, 40)
toggleButton.Position = UDim2.new(1, -170, 1, -60)
toggleButton.AnchorPoint = Vector2.new(0, 0)
toggleButton.BackgroundColor3 = Color3.fromRGB(15, 15, 15) -- Obsidian black
toggleButton.BorderColor3 = Color3.fromRGB(60, 60, 60)
toggleButton.BorderSizePixel = 2
toggleButton.Font = Enum.Font.GothamBold
toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
toggleButton.TextSize = 14
toggleButton.Text = "Hide Player Info"
toggleButton.Parent = screenGui

local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0, 6)
uiCorner.Parent = toggleButton

toggleButton.MouseButton1Click:Connect(function()
	isInfoVisible = not isInfoVisible
	toggleButton.Text = isInfoVisible and "Hide Player Info" or "Show Player Info"
	toggleButton.BackgroundColor3 = isInfoVisible and Color3.fromRGB(15, 15, 15) or Color3.fromRGB(40, 15, 15)
	
	for _, player in ipairs(Players:GetPlayers()) do
		if player ~= LocalPlayer and player.Character then
			local head = player.Character:FindFirstChild("Head")
			if head then
				local billboard = head:FindFirstChild("DetailedCasting_PlayerHeadInfo")
				if billboard then
					billboard.Enabled = isInfoVisible
				end
			end
		end
	end
end)

-- ==============================================================================
-- DATA EXTRACTION UTILITIES
-- ==============================================================================

local function getPlayerWealth(player)
	local leaderstats = player:FindFirstChild("leaderstats")
	if leaderstats then
		local currency = leaderstats:FindFirstChild("Cash") or leaderstats:FindFirstChild("Coins")
		if currency then
			return tostring(currency.Value)
		end
	end
	return "N/A"
end

local function getEquippedTool(character)
	local tool = character:FindFirstChildOfClass("Tool")
	return tool and tool.Name or "None"
end

local function getJumpStat(humanoid)
	if humanoid.UseJumpPower then
		return math.floor(humanoid.JumpPower)
	else
		return math.floor(humanoid.JumpHeight)
	end
end

-- ==============================================================================
-- LIVE PLAYER TRACKING LOGIC
-- ==============================================================================

local function updateInformation(targetPlayer, character, textLabel)
	if not character or not character.Parent then return end
	
	local head = character:FindFirstChild("Head")
	local humanoid = character:FindFirstChild("Humanoid")
	local hrp = character:FindFirstChild("HumanoidRootPart")
	
	local localChar = LocalPlayer.Character
	local localHrp = localChar and localChar:FindFirstChild("HumanoidRootPart")
	
	if head and humanoid and hrp then
		-- Core Identity
		local displayName = targetPlayer.DisplayName
		local name = targetPlayer.Name
		local userId = targetPlayer.UserId
		local accountAge = targetPlayer.AccountAge
		local premiumStatus = (targetPlayer.MembershipType == Enum.MembershipType.Premium) and "Premium" or "Standard"
		
		-- Vitals & Factions
		local health = math.floor(humanoid.Health)
		local maxHealth = math.floor(humanoid.MaxHealth)
		local team = targetPlayer.Team and targetPlayer.Team.Name or "None"
		local wealth = getPlayerWealth(targetPlayer)
		
		-- Physics & Mechanics
		local walkSpeed = math.floor(humanoid.WalkSpeed)
		local jumpStat = getJumpStat(humanoid)
		local currentState = humanoid:GetState().Name -- E.g., "Freefall", "Running", "Seated"
		local toolName = getEquippedTool(character)
		
		-- Spatial Data
		local distance = 0
		if localHrp then
			distance = math.floor((hrp.Position - localHrp.Position).Magnitude)
		end
		
		-- Dynamic String Assembly (Clean & Modular)
		local text = string.format("👤 %s (@%s)\n", displayName, name)
		text ..= string.format("🆔 ID: %d | 📅 %dd | 💎 %s\n", userId, accountAge, premiumStatus)
		text ..= string.format("❤️ HP: %d/%d | 🛡️ %s\n", health, maxHealth, team)
		text ..= string.format("📏 Dist: %d studs | 💰 %s\n", distance, wealth)
		text ..= string.format("⚡ Spd: %d | 🚀 Jmp: %d\n", walkSpeed, jumpStat)
		text ..= string.format("🏃 Action: %s\n", currentState)
		text ..= string.format("⚔️ Eqp: %s", toolName)

		-- Apply text
		textLabel.Text = text
	end
end

local function setupCharacter(targetPlayer, character)
	if targetPlayer == LocalPlayer then return end

	local head = character:WaitForChild("Head", 5)
	if not head then return end
	
	local billboardGui = Instance.new("BillboardGui")
	billboardGui.Name = "DetailedCasting_PlayerHeadInfo"
	billboardGui.Size = GUI_SIZE
	billboardGui.StudsOffset = STUDS_OFFSET
	billboardGui.AlwaysOnTop = true
	billboardGui.Enabled = isInfoVisible
	billboardGui.Adornee = head
	billboardGui.Parent = head 
	
	local textLabel = Instance.new("TextLabel")
	textLabel.Name = "InfoText"
	textLabel.Size = UDim2.new(1, 0, 1, 0)
	textLabel.BackgroundTransparency = 1
	textLabel.Font = Enum.Font.GothamBold
	textLabel.TextScaled = true
	textLabel.TextColor3 = Color3.new(1, 1, 1) 
	textLabel.TextStrokeTransparency = 0.2 -- Slight transparency for a softer, premium shadow
	textLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
	textLabel.Parent = billboardGui

	updateInformation(targetPlayer, character, textLabel)

	task.spawn(function()
		while character and character.Parent and textLabel and textLabel.Parent do
			task.wait(UPDATE_INTERVAL)
			if billboardGui.Enabled then
				updateInformation(targetPlayer, character, textLabel)
			end
		end
	end)
end

local function handlePlayer(player)
	if player == LocalPlayer then return end
	
	if player.Character then
		task.spawn(setupCharacter, player, player.Character)
	end
	
	player.CharacterAdded:Connect(function(character)
		setupCharacter(player, character)
	end)
end

for _, player in ipairs(Players:GetPlayers()) do
	handlePlayer(player)
end

Players.PlayerAdded:Connect(handlePlayer)

Features & Information

The DetailedCasting_PlayerHeadInfo script is an elite, highly optimized Roblox LocalScript engineered to serve as a comprehensive real-time player telemetry system. Upon execution, it dynamically generates a sleek, visually scaling BillboardGui anchored to every other player's head in the server, providing a live, continuous data feed of their in-game status. This powerful visualizer extracts an unprecedented level of metadata, seamlessly blending static identity details—such as display names, account ages, user IDs, and premium membership statuses—with highly volatile, live-action metrics. These real-time metrics track spatial distance from the local player, precise health values, active movement speeds, jump power statistics, currently equipped tools, in-game wealth, and even the live physical state of the player's humanoid, detecting whether they are running, falling, or seated. To ensure maximum user control and screen clarity, the script automatically mounts an Obsidian-themed graphical toggle button to the local player's screen, allowing them to instantly hide or reveal the entire data network on the fly. Under the hood, the architecture utilizes asynchronous coroutines and intelligent state-checking to constantly poll this information without throttling the main engine thread, elegantly pausing its most demanding mathematical calculations whenever the display is toggled off to guarantee flawless frame rates and zero memory leaks.

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts