I'm making an rpg and i was wondering how to make a script for a monster to drop an item such as coins when it dies
There are different ways to go about this and the best solution would depend on your use case, but generally you create prefab for what you're dropping, and when you're dropping it, call Instantiate. A simple implementation is that in the 3D platformer tutorial's EnemyDamage script.
var coins : Transform; //a prefab to instantiate
function Update() {
if( health <= 0) { //die
Destroy(gameObject);
Instantiate(coins, transform.position, Quaternion.identity);
}
}