• Stopping physgun pickup
    2 replies, posted
I was wondering how I stop an entity I made from being able to be picked up by a physgun, I want it to be so you can only pick it up using a gravgun. Some info, this is on a local darkrp test server. xP cl_init: [CODE]include("shared.lua")[/CODE] shared: [CODE]ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "Cocaine Plant" ENT.Author = "Skashh" ENT.Spawnable = true[/CODE] init: [CODE]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") hook.Add("InitPostEntity", "spawnplants", function() local plant = ents.Create("coke_plant") plant:Spawn() end) function ENT:Initialize() self:SetModel( "models/props/cs_office/plant01.mdl" ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) if ( SERVER ) then self:PhysicsInit( SOLID_VPHYSICS ) end local phys = self:GetPhysicsObject() if ( IsValid( phys ) ) then phys:Wake() end self:SetPos(Vector(-2268, -156, -132)) end function PhysgunPickup( ply, ent ) if ( ent:GetClass() == "coke_plant" and ply.IsValid() ) then return false end end hook.Add( "PhysgunPickup", "Allow Physgun Pickup", PhysgunPickup )[/CODE]
Not exactly a lua solution, but as you are running darkrp you can add the entity to the physgun blacklist with Falco's Prop Protection.
For some reason when I click on the FPP, physgun options my entity doesn't show up there just a bunch of the base darkrp ones. xP [editline]22nd December 2015[/editline] Nevermind, I got it working in FPP, thanks! :)
Sorry, you need to Log In to post a reply to this thread.