no one can't give you a %100 working script without knowing your code.
And there are several ways to simulate gravity depending on the project. Tell us about your technique and then we can suggest solutions(as i said no one can offer %100 working script).