Garry's Mod Wiki

util.GetSurfaceData

  table util.GetSurfaceData( number id )

Description

Returns data of a surface property at given ID.

Arguments

1 number id
Surface property ID. You can get it from Structures/TraceResult.

Returns

1 table
The data or no value if there is no valid surface property at given index.

See Structures/SurfacePropertyData

Example

Prints the Surface Property Data of the place the player is looking at when executing the console command.

concommand.Add( "surfprop", function( ply ) local surface = ply:GetEyeTrace().SurfaceProps PrintTable( util.GetSurfaceData( surface ) ) end )
Output:
breakSound = bulletImpactSound = concrete.bulletimpact climbable = 0 dampening = 0 density = 2400 elasticity = 0.20000000298023 friction = 0.80000001192093 hardThreshold = 0.5 hardVelocityThreshold = 0 hardnessFactor = 1 impactHardSound = concrete.impacthard impactSoftSound = concrete.impactsoft jumpFactor = 1 material = 67 maxSpeedFactor = 1 name = concrete reflectivity = 0.66000002622604 rollingSound = roughThreshold = 0.5 roughnessFactor = 1 scrapeRoughSound = concrete.scraperough scrapeSmoothSound = concrete.scrapesmooth stepLeftSound = concrete.stepleft stepRightSound = concrete.stepright strainSound = thickness = 0