I’m working on modifying prophunt as a way to learn/get into lua. I have experience in programming. I got the syntax down, now I’m just trying to learn all the functions and such.
Ok so I found a way to lock the prop in a orientation based on pl:EyeAngles(), the problem I’m running into is the prop is floating on the x angle.
This is what I got
-- The GetLocked and GetLockAngles are NetworkVars function ENT:Draw() local pl = self:GetOwner() local Locked = self:GetLocked() local Angles = Angle(0,0,0) if Locked then Angles = self:GetLockAngles() else Angles = pl:EyeAngles() end -- Angles self:SetAngles(Angles) -- Pos self.Entity:SetPos(pl:GetPos() - Vector(0, 0, self.Entity:OBBMins().z)) self:SetPos(pl:GetPos() - Vector(0, 0, self.Entity:OBBMins().z)) self.Entity:DrawModel() self:SetLockAngles(Angles) end
I’ve tried a few things but just can’t seem to get the prop to stay on the ground, all I’ve figured out is that the Z Pos is what needs to be changed. Anyone got any Ideas.