Dupe support

hello all, i am trying to add dupe support for my nocollide all multi tool but it isnt working, what is wrong with this code?

[lua]
local function SetGroup(Entity,onoff)
if onoff == 1 then
Entity:SetCollisionGroup( COLLISION_GROUP_WORLD )
data.collisiongroup = COLLISION_GROUP_WORLD
end
if onoff == 0 then
Entity:SetCollisionGroup( COLLISION_GROUP_NONE )
data.collisiongroup = COLLISION_GROUP_NONE
end
duplicator.StoreEntityModifier( Entity, “nocollideall”, data)
end
duplicator.RegisterEntityModifier( “nocollideall”, SetGroup )
[/lua]

thanks all

data is nil?

data is supposed to be the collision group.
[editline]edit[/editline]
changed is to
[lua]local function SetGroup(Entity,Data)

Entity:SetCollisionGroup(Data.Group)

duplicator.StoreEntityModifier( Entity, "nocollideall" , Data)

end
duplicator.RegisterEntityModifier( “nocollideall”, SetGroup )

function TOOL:RightClick(trace)
if table.Count(self.enttbl) < 1 then return end

local freeze = self:GetClientNumber( "freeze" )
local onoff = self:GetClientNumber( "on" )
local nocollidetobase = self:GetClientNumber( "base" )

local ent = trace.Entity

for k,v in pairs(self.enttbl) do
	local prop = ents.GetByIndex(k)
	if IsValid(prop) then
		prop:SetColor(v.r,v.g,v.b,v.a)
		if onoff == 1 then
			group = COLLISION_GROUP_WORLD
		end
		if onoff == 0 then
			group = COLLISION_GROUP_NONE
		end	
		SetGroup(prop,{Group = group})

[/lua]

changed it again and got this error
[lua][addons
ocollideall\lua\weapons\gmod_tool\stools
ocollideall_multi.lua:23] attempt to call field ‘StoreEntityModifier’ (a nil value)
[/lua]
just to see if it works, no success.

Something’s overriding the duplicator library. Maybe you named some variable ‘duplicator’ somewhere else in the code?

I’m going to start yelling “DATA IS NIL!” every time I don’t understand something I hear.

According to the wiki, the duplicator library is going to call your entity modifier function with these arguments: ( Player, Entity, Data )

You must put player as the first argument to the function, even if you don’t use that variable.