Need help with client side

Hey, im trying to draw a box above all the spawn points on the map through client side

This is my code so far

for k,v in pairs(ents.FindByClass(“info_player_start”)) do
local pos = v:GetPos() + Vector(0,0,50)
local ang = v:GetAngles()
Msg(“Found Spawn Point”)
cam.Start3D(pos,ang)
draw.RoundedBox( 8, 50, 50, 100, 100, Color( 255, 255, 255 ) )
cam.End3D()
end

if it makes a difference im running it by going lua_openscript_cl test.lua

You need to put this in a 3D rendering hook, at the moment it may be drawing this for one frame only.

here are some 3D rendering hooks that i have got to work with drawing:
PostPlayerDraw
PrePlayerDraw
RenderScene

Thanks, but its not working
this is what i tried

function DrawBox()
for k,v in pairs(ents.FindByClass(“info_player_start”)) do
local pos = v:GetPos() + Vector(0,0,50)
local ang = v:GetAngles()
Msg(“Found Spawn Point”)
cam.Start3D(pos,ang)
draw.RoundedBox( 8, 50, 50, 100, 100, Color( 255, 255, 255 ) )
cam.End3D()
end
end
hook.Add(“PostPlayerDraw”, “DrawBox”, DrawBox)

Change this:


local ang = v:GetAngles()

to


local ang = LocalPlayer():EyeAngles()

See if that works.

Still nothing :frowning:
Its not even saying “Spawn Point Found”

Try using one of the other rendering hooks.

Ive tried all of the hooks

I wouldn’t normally suggest rendering in 3D in a HUDPaint hook, but try that.

Nothing :confused:

[editline]02:00PM[/editline]

Is the something wrong with my code?
Or is there just no interval?

It seems that info_player_starts are not available clientside (try putting this into the console: lua_run_cl PrintTable(ents.FindByClass(“info_player_start”))).

[editline]02:05PM[/editline]

So your for loop isn’t running.

ahh i see, its not showing
this means you cand find them through client side right?
Btw is it possible to parent the box to a entity such as a player

Of course, just use the position of a player. Should be obvious enough if you know what you are doing.

As far as I know, info_player_start at any other point entities don’t even exist clientside.