Attempt to compare Vector3 <= Vector3

local tp = camera.CFrame.Position
	local aa,bb,cc = PtoT(tp.X,tp.Y,tp.Z)
	local bl,ch = getBlock(aa,bb,cc)
	local exist = getBlockID(bl)
	
	L_CC.Brightness = 0
	L_CC.Contrast = -.1
	L_CC.Saturation = -.2
	L_CC.TintColor = Color3.new(1,1,1)
	
	local isBreathable = (bb >= (128)) or (bb < 0) or (not exist) or (exist == 0) or not isSolid(exist) or (idinfo[exist] and idinfo[exist].transparent)


how to fix it?

You can’t compare vector3’s bb is most likely a vector3 you can use .Magnitude to get the length of the vector, the code you provided doesn’t really help much and is also pretty hard to read

1 Like

do

vector3.Magnitude < something
1 Like

you should put this on an if thingy

if (bb >= (128)) or (bb < 0) or (not exist) or (exist == 0) or not isSolid(exist) or (idinfo[exist] and idinfo[exist].transparent) then

also how is that script so long


Where should I put it?

to this

if (bb >= (128)) or (bb < 0) or (not exist) or (exist == 0) or not isSolid(exist) or (idinfo[exist] and idinfo[exist].transparent) then
1 Like

He doesn’t need an if because he is storing a boolean as a variable. His problem is that he is using Vector3s on that line.

3 Likes

Maybe something like this?

if (Vector1.X <= Vector2.X) and (Vector1.Y <= Vector2.Y) and (Vector1.Z <= Vector2.Z) then
return print('Matches');
end;
1 Like