DDOS protection involves having multiple nodes to split traffic when it is overloaded so that the main node doesn't crash. There is no script that will block DDOS protection. Rather, you need to set up a network of VPS/dedicated boxes that can handle the attack. There's a reason DDOS protection services cost hundreds of dollars monthly.
The best defense for the site from ddos attacks are not programs and not scripts. You just need to use a secure server with DDoS protection.
For example i can recommend you Swiss reliable server with DDoS protection. swisshosters (google it)
What kind of server you are using the anti-DDos program vary from type of server,rather its linux or window or java based server?Otherwise simple choose a anti -DDos tool which are so many available in the market.