Why didn't you just ask me? =(
I can tell you how to do this very easily.
1. Printing Players Names to chat when they enter the brush.
Create a new entity folder called like "garrysmod/lua/entities/mynewbrush"
Inside this folder create an init.lua file and include the following in the file.
ENT.Base = "base_brush"
ENT.Type = "brush"
function ENT:StartTouch( entity )
if(entity:IsPlayer() and entity:IsValid() then
for _, v in pairs(player.GetAll()) do
v:PrintMessage(HUD_PRINTTALK, entity:GetName().. " has entered the lua brush area.")
end
end
end
This will print the message every time a player STARTS to touch the brush. It will not display for the SAME player again until the player leaves the brush and returns.
2. How many players are in the brush.
Put this in a lua file that is run at startup. Either in your init.lua file, if you are making a gamemode.. or in a lua file in garrysmod/lua/autorun/server/
local numberofplayers = 0
for _,v in pairs(player.GetAll()) do
local pos = v:GetPos()
for _,v in pairs (ents.FindInSphere( pos, 15 )) do
if v:GetClass() == "mynewbrush" then
numberofplayers = numberofplayers + 1
end
end
end
Where it says v:GetClass() == "mynewbrush"... obvioulsy mynewbrush is whatever you called your entity from above. With entities, whatever you call the folder that the init file is in is the name of the entity.
also.. I set up a lua help forum on our forum a long time ago JUSt for this type of thing. Myself or B!G would have helped you if you would have just asked =)