Help with simple lua script.

If only works on players. I want it to work on everything but players.

[lua]
function floatstuff(ply)

plaim = ply:GetEyeTrace( ).HitPos  

floatents = ents.FindInSphere(plaim , 100 )  

for k, v in pairs(floatents) do  

  
  
    v:SetGravity( -100 )  

end  

end

concommand.Add(“float”, floatstuff)
[/lua]


concommand.Add("float",function(ply)
	for _,v in pairs(ents.FindInSphere(ply:GetEyeTrace().HitPos,100)) do
		if not v:IsPlayer() then v:SetGravity(0)
	end
end)

There you go.

I knew how to do that but if I didn’t filter anything out in the first place, why would props not float?

You’re not filtering ANYTHING in that code, it’s finding every single object around you in that radius and setting it’s gravity to -100 :/, I dunno why that’s not doing anything to props. Add a search for prop_physics?

Probably because SetGravity only works between 1 and 0.