timer.Create(1, function() ents.AddCreateCallback('math_remap', function(ent) timer.Create(0.015, function() --print(ent.m_vecOrigin) local initialvecorigin = ent.m_vecOrigin local initialentityname = ent:GetName() ent:Remove() local TraceDownwards = { start = initialvecorigin, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 8192, -- Used if endpos is nil angles = Vector(90,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local downTraceTable = util.Trace(TraceDownwards) local creationtarget = Entity("math_colorblend", true) local entitymaker = ents.FindByName("individualfiremaker") creationtarget:SetName("putfirehere"..creationtarget:GetHandleIndex()) --print(creationtarget:GetHandleIndex()) if downTraceTable["HitPos"] == nil then downTraceTable["HitPos"] = Vector(0,0,-1000) end creationtarget:SetAbsOrigin(downTraceTable["HitPos"]) local anglestouse = Vector(0,0,0) if(initialentityname == "alternativefiremathtarget_0") then anglestouse = Vector(0,0,0) elseif(initialentityname == "alternativefiremathtarget_90") then anglestouse = Vector(0,90,0) elseif(initialentityname == "alternativefiremathtarget_180") then anglestouse = Vector(0,180,0) elseif(initialentityname == "alternativefiremathtarget_270") then anglestouse = Vector(0,270,0) end timer.Create(0.015, function() --print("found math remap") entitymaker:AcceptInput("ForceSpawnAtEntityOrigin", creationtarget:GetName()) --ent:SetAbsOrigin(downTraceTable["HitPos"]) creationtarget:Remove() local TraceDiagonally = { start = initialvecorigin, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 4096, -- Used if endpos is nil angles = anglestouse + Vector(45,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local diagonalTraceTable = util.Trace(TraceDiagonally) local creationtarget2 = Entity("math_colorblend", true) if diagonalTraceTable["HitPos"] == nil then diagonalTraceTable["HitPos"] = Vector(0,0,-1000) end creationtarget2:SetAbsOrigin(diagonalTraceTable["HitPos"]) creationtarget2:SetName("putfirehereaswell"..creationtarget2:GetHandleIndex()) timer.Create(0.15, function() entitymaker:AcceptInput("ForceSpawnAtEntityOrigin", creationtarget2:GetName()) local TraceDiagonally2 = { start = initialvecorigin, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 4096, -- Used if endpos is nil angles = anglestouse + Vector(27,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } creationtarget2:Remove() local diagonalTraceTable2 = util.Trace(TraceDiagonally2) local creationtarget3 = Entity("math_colorblend", true) if diagonalTraceTable2["HitPos"] == nil then diagonalTraceTable2["HitPos"] = Vector(0,0,-1000) end creationtarget3:SetAbsOrigin(diagonalTraceTable2["HitPos"]) creationtarget3:SetName("putfirehereaswelltoo"..creationtarget3:GetHandleIndex()) timer.Create(0.15, function() entitymaker:AcceptInput("ForceSpawnAtEntityOrigin", creationtarget3:GetName()) creationtarget3:Remove() local TraceDiagonally3 = { start = initialvecorigin, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 4096, -- Used if endpos is nil angles = anglestouse + Vector(18,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local diagonalTraceTable3 = util.Trace(TraceDiagonally3) local creationtarget4 = Entity("math_colorblend", true) if diagonalTraceTable3["HitPos"] == nil then diagonalTraceTable3["HitPos"] = Vector(0,0,-1000) end creationtarget4:SetAbsOrigin(diagonalTraceTable3["HitPos"]) creationtarget4:SetName("putfirehereaswellnice"..creationtarget4:GetHandleIndex()) timer.Create(0.15, function() entitymaker:AcceptInput("ForceSpawnAtEntityOrigin", creationtarget4:GetName()) creationtarget4:Remove() local TraceDiagonally4 = { start = initialvecorigin, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 4096, -- Used if endpos is nil angles = anglestouse + Vector(13,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local diagonalTraceTable4 = util.Trace(TraceDiagonally4) local creationtarget5 = Entity("math_colorblend", true) if diagonalTraceTable4["HitPos"] == nil then diagonalTraceTable4["HitPos"] = Vector(0,0,-1000) end creationtarget5:SetAbsOrigin(diagonalTraceTable4["HitPos"]) creationtarget5:SetName("putfirehereaswellnice"..creationtarget5:GetHandleIndex()) timer.Create(0.15, function() entitymaker:AcceptInput("ForceSpawnAtEntityOrigin", creationtarget5:GetName()) creationtarget5:Remove() end, 1) end, 1) end, 1) end, 1) end, 1) end, 1) end) end, 1)