Player position/vector problems

So basically I’m trying to do a Vector:WithinAABox kind of thing, where if the player’s position is within these vectors, and the player press +use, he will be teleported somewhere, but the WithinAABox doesn’t seem to work, but I’m just not using it right.
http://pastebin.com/9QFfcUyy Here’s my whole code, the vector withinaabox code starts at line 110.

PS: Please don’t hate for the NWInt stuff. I plan on changing that eventually

Have you tried to print the player position and manually checking if it is in the box?

Relatively off-topic and on-topic, but I would if I wasn’t administrating 46x 12 years old -_-

I don’t need your excuses, if you didn’t, do.

Just did, returns false.

You mean like this?


print(ply:GetPos())
			if Vector(-1870.657471,-392.884827,-4863.968750):WithinAABox(Vector(-1903.97,-384.00,-4799.97),Vector(-1849.11,-386.03,-4799.97))
		then	ply:SetPos(Vector(-2028.63,-476.51,-4774.08))	
			end

[lua]
local vCenter = Vector(825.862244, -121.231918, -143.968750) //center of the box
local boxSize = Vector(50,50,90)
local corner1 = vCenter-Vector(boxSize.x,boxSize.y, 0)
local corner2 = vCenter+boxSize
local telePos = Vector()

if SERVER then
AddCSLuaFile()
hook.Add(“KeyPress”, “KeyPress.TeleportBox”, function(ply, key)
if (key == IN_USE) and ply:GetPos():WithinAABox(corner1, corner2) then
ply:SetPos(telePos)
end
end)
else
hook.Add(“PostDrawOpaqueRenderables”, “PDOR.TeleBoxDebug”, function()
render.DrawWireframeBox(vCenter, Angle(), -Vector(boxSize.x,boxSize.y, 0), boxSize, Color(0,0,255), true)
end)
end
[/lua]

thanks alot, for like the 10th time