temp.w is a weapon, not a string! Stop abusing your objects!
PHP Code:
temp.w.name.starts("Test/")
PHP Code:
temp.w.name in temp.except
PHP Code:
player.removeWeapon(temp.w.name)
Also, the minimum sleep value on serverside is 0.1, not 0.05, and you lose the player scope when you sleep, so
player.addWeapon isn't going to work anyway.