Update trap.lua

Use a table insted of 4 if/elseif statments.