Simple script to get trace results serverside on nanos world
🐙 GitHub
https://github.com/Timmy-the-nobody/Server-Traces
This will expose a new table (SVTrace) that works in a similar way than nanos world's Trace library
New functions:
SVTrace.BoxMultiSVTrace.BoxSingleSVTrace.CapsuleMultiSVTrace.CapsuleSingleSVTrace.LineMultiSVTrace.LineSingleSVTrace.SphereMultiSVTrace.SphereSingle
🛠️ Usage example
If you want to mimic a client trace that would be
Trace.LineSingle(
Vector(0, 0, 100),
Vector(0, 0, -100),
CollisionChannel.WorldStatic,
TraceMode.ReturnEntity,
{}
)
You'd just have to call it the same way on the serverside (inside the SVTrace table instead of Trace), and with a callback to handle the result (and optionnaly the player who should have the authority on it), like:
SVTrace.LineSingle(
Vector(0, 0, 100),
Vector(0, 0, -100),
CollisionChannel.WorldStatic,
TraceMode.ReturnEntity,
{},
function(tRes)
print(NanosTable.Dump(tRes))
end,
Player.GetByIndex(1)
)