Gamemode LUA -> trigger_push

First off, I’m new to this community, I’ve lurked in threads and looked up resources and such, and I did some searching before I decided to make a new thread. I wasn’t sure whether to stick this in the ‘mapping’ section, the ‘Gamemode’ section, or the ‘LUA Scripting’ section, so I made a guess with the ‘Newbie Questions’ sub-forum and hope it works out in the end.

So heres the deal, I’m working on a gamemode, and want to be able to seal off certain areas of the map from players via the ‘trigger_push’ brush placed on the map. I’ve got ‘Start Disabled’ set to true for these brushes and it all works fine when on or off. Each of these brushes are named ‘rw_block_#’ where # is their unique identifier.

I’m pretty sure that I can get the instances of these ‘trigger_push’ entities via:


blocktable = ents.FindByName( "rw_block_" )

which would be run from a server-side lua file in the end.

I think I can then work with each of the returned entities via:



for k, v in pairs( blocktable ) do
  if v:IsWorld() then

  end
end


The question is, if I have this set up correctly, how would I then set whether the trigger_push would push the player or not?

Added Note:
Would


v.Fire( "Toggle" )

possibly work?

Added on after the fact in case someone finds this in a search:
ents.FindByName( “rw_block_” ) will not find world brushes, thus will not work, a substitute I used was:



	local spawnpointsbroad = ents.FindByClass( "info_target" )
	local spawnpoints	= {}
	
	for i=1, table.Count( spawnpointsbroad ) do
		if string.find( spawnpointsbroad*:GetName(), "rw_itemspawn" ) != nil then
			spawnpoints[ table.Count( spawnpoints) + 1 ] = spawnpointsbroad*
		end
	end


I used named info_targets on the map.

v:Fire(“Toggle”)

Ah yes, a colon. I have to remember that so far in my cases colons are to execute, and periods are to redefine.

Question solved, thanks very much.

No, they’re not. Colons represent a method - a period represents a function (Or a variable) that is part of a table