• VIP blocker
    4 replies, posted
Hello FacePunch I am trying to make a ent that would block non VIP's form an area of a map. I have it up and running on the server there are no errors and I can see the block but it lets any one pass right through it what am I doing wrong? cl_init.lua [CODE] include('shared.lua'); ENT.RenderGroup = RENDERGROUP_TRANSLUCENT local tex = surface.GetTextureID("GTFO") function ENT:Initialize() self.Entity:SetRenderBounds( Vector()*-64, Vector()*64 ) if LocalPlayer():IsVIP() then self.Entity:SetSolid( SOLID_NONE ) end end function ENT:Think() if LocalPlayer():IsVIP() then self.Entity:SetSolid(SOLID_NONE) else self.Entity:SetSolid(SOLID_VPHYSICS) end end function ENT:Draw() local pl = LocalPlayer() if pl:IsVIP() then return end local pos = self.Entity:GetPos() + self.Entity:GetUp() * 54 local dir = self.Entity:GetForward() local dis = pl:EyePos():Distance(pos) if dis >= 500 then return end local alpha = 255*(500-dis)/500 surface.SetTexture(tex) render.DrawQuadEasy( pos, dir, 64, 64, Color( 255, 255, 255, alpha ) ) end [/CODE]
Maybe you should stop straight copy-paste from sassilization lounge and code it yourself?
I did and it did not work so I looked at other peoples stuff to see how they did it and it still wont work I was wondering if any one else had any other solution?
Post IsVIP() because there might be a problem with the function return. Check to make sure the physics bounds for the prop you are using is large enough to not let people pass. Just because you made the render bounds larger, doesn't mean the collision has changed.
Ok thank you I will have a look when I get back home Thanks
Sorry, you need to Log In to post a reply to this thread.