• Simple Entity can't be used with Grav Gun?
    1 replies, posted
For some reason this Entity won't do anything when right clicked with a Grav Gun: [LUA] AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function ENT:Initialize() self.Entity:SetModel("models/weapons/w_bugbait.mdl") self.Entity:SetNWBool("Weed", true) self.Entity:PhysicsInit(SOLID_VPHYSICS) self.Entity:SetMoveType(MOVETYPE_VPHYSICS) self.Entity:SetSolid(SOLID_VPHYSICS) self.Entity:SetUseType(SIMPLE_USE) self.Entity:SetColor(0, 255, 0, 255) local phys = self.Entity:GetPhysicsObject() if phys and phys:IsValid() then phys:Wake() end self.sparking = false self.damage = 100 local ply = self.Entity:GetNWEntity("owning_ent") end function ENT:OnTakeDamage(dmg) self.damage = self.damage - dmg:GetDamage() if (self.damage <= 0) then self.Entity:Remove() end end function ENT:Use() end function ENT:OnRemove() timer.Destroy(self.Entity:EntIndex()) local ply = self.Entity:GetNWEntity("owning_ent") if not ValidEntity(ply) then return end end [/LUA]
Put this under you check for the PhysicsObject: phys:SetMass(20)
Sorry, you need to Log In to post a reply to this thread.