Ok, on the offchance that this might help someone else finish it off, here's what i was trying to do:
Code:
local c = Collection()
nonades = trigger_ff_script:new({})
function nonades:ontouch( touch_entity )
if IsPlayer( touch_entity ) then
local player = CastToPlayer( touch_entity )
-- Add this player to the collection
c:AddItem( player )
end
end
function nonades:onendtouch( touch_entity )
if IsPlayer( touch_entity ) then
local player = CastToPlayer( touch_entity )
-- Remove player from collection
c:RemoveItem( player )
end
end
-- This is fired when everyone has stopped touching "nonades"
-- and it goes to its inactive state
function nonades:oninactive()
-- Clear out the items in the collection
c:RemoveAllItems()
end
function player_onthrowgren2(player, prime)
if c:Count() == 0 then
return EVENT_ALLOWED
end
for temp in c.items do
local c_player = CastToPlayer( temp )
if c_player == player then
return EVENT_DISALLOWED
end
end
return EVENT_ALLOWED
end
Didn't work, however using a gren inside the nonades area did produce an error, whereas using it outside of it did not... so it must be on the right track, I think.