
550 Views
24 Executions
Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
a function used for debugging raycasts, useful for silent aims
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
0Log in to join the conversation. Login
No comments yet. Be the first!
SOURCE | RaycastDebug







