I'm fiddling about with gMod trying to make a gamemode where you have to throw a piece of cake into a cylinder that spawns on the map.
This is the code I'm using to spawn the cylinder:
local ent = ents.Create( "prop_physics" ) ent:SetModel("models/props_phx/construct/windows/window_curve360x1.mdl") ent:SetPos( Vector(math.random(100,2500), math.random(1500,-1000), 150) ) --ent:SetPos( math.random(-1500,-2500), math.random(-1500,-2500), 100 ) ent:Spawn() cleanup.Add( self.Owner, "props", ent ) undo.Create( "Spawned_Cylinder" ) undo.AddEntity( ent ) undo.SetPlayer ( self.Owner ) undo.Finish()
The cake throwing part is basically just a SWEP that shoots the 'cakehat' prop. How would I test whether there is a piece of a cake inside the cylinder?