#👁 Server Traces

1 messages · Page 1 of 1 (latest)

grave kayak
#

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.BoxMulti
  • SVTrace.BoxSingle
  • SVTrace.CapsuleMulti
  • SVTrace.CapsuleSingle
  • SVTrace.LineMulti
  • SVTrace.LineSingle
  • SVTrace.SphereMulti
  • SVTrace.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)
)
#

👁 Server Traces

grave kayak
#

Updated for >= 1.22.0 nanos world versions