Vectors

How do you return them?
My function keeps returning nil or 1.0, 1.0, 1.0
[lua] for k,v in pairs(orgin_ents) do
if v:GetClass() == “prop_vehicle_jeep” then
Msg("Debug Second!
")
local pos = Vector(81.458130, 297.146637, -84.165848)
return Vector(pos)
else
Msg("Third Debug
")
pos = {}
pos = {197.234665, 521.098206, -84.149338}
return pos[1],pos[2],pos[3]
end
end[/lua]

Can we see the code for this function?

Done.

Just return pos, not Vector( pos )

On line 5 do



return pos


Or, if you like, cut out the local variable and do



return Vector(81.458130, 297.146637, -84.165848)


I’m not sure what’s going on at lines 8-10, trying a different approach?

Also on line 8 you’ve not made pos local, so it clutters up the global table (unless you’ve already declared it as local earlier)