Wouldn't the values read from the color sensor be colorVal1 and colorVal2, not val and val1?
What kind of sensors are these?
Why is it necessary to have two print statements in each case?
More importantly, what if a robot has not picked up a ball at all, you are having each robot telling the other what color ball it picked up on every pass through loop, without any way of knowing that the robot has actually picked up a ball.
Now, on to the really important questions. What kind of XBees are you using, and how have you configured them? Do you KNOW that they actually talk to each other?
What problem(s) are you having? All I got from reading your post is that you are having problems, but you didn't say what they are.
there is no one to help me out i live in Beijing and they hardly speak english
If you live in Beijing and expect to communicate with the people there, should you learn Chinese, rather than expect them to learn English?