Update trap.lua

Use a table insted of 4 if/elseif statments.
Update trap.lua
Update trap.lua
Merge pull request #866 from WibbenZ/patch-7

Update trap.lua