ent_remove(me) is risky when you call it early in a function. In your code, you remove the entity, but the rest of the code in the function is still being read. All your my.whatever = x calls after ent_remove are coming up ambiguous because, since you deleted the entity, the engine doesn't know what "my" is.