Universal Script 📌
561 Views
33 Executions

Script Verified SOURCE | RaycastDebug

Universal Script 📌
binary
binary
Verified Badge
Verified User
100 followers
9 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

a function used for debugging raycasts, useful for silent aims

View Raw
local Players = game:GetService("Players")
local WorkspaceService = game:GetService("Workspace")
local LocalPlayer = Players.LocalPlayer

local Separator = string.rep("=", 60)
local LogLimit = 50
local LogCount = 0

warn("\n" .. Separator)
warn("  RAYCAST DEBUGGER")
warn("  Logging next " .. LogLimit .. " raycasts from your character")
warn(Separator .. "\n")

local function GetCallerInfo()
    local Info = debug.info(4, "sln")
    if Info then
        return tostring(Info)
    end
    return "Unknown"
end

local function FormatVector(Vec)
    if typeof(Vec) ~= "Vector3" then
        return tostring(Vec)
    end
    return string.format("(%.1f, %.1f, %.1f)", Vec.X, Vec.Y, Vec.Z)
end

local OldNamecall
OldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(Self, ...)
    local Method = getnamecallmethod()

    if Method == "Raycast" and Self == WorkspaceService then
        local Origin, Direction, Params = ...
        if typeof(Origin) == "Vector3" and typeof(Direction) == "Vector3" then
            local Character = LocalPlayer.Character
            local Head = Character and Character:FindFirstChild("Head")
            local HeadDist = Head and (Origin - Head.Position).Magnitude or -1

            if HeadDist < 10 or HeadDist == -1 then


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Script hub
282
313
Bumped 43 minutes ago

Script hub

Blythe

Script hub
8.9k
55.1k
Bumped 2 hours ago
Key System
Script hub
503
6.4k
Bumped 5 hours ago
Key System
Universal Script 📌
7.2k
104.7k
Bumped 7 hours ago
Script hub
512
2.1k
Bumped 8 hours ago
Key System
Universal Script 📌
317
2.5k
Approved 11 hours ago