func _ready():
var timer = Timer.new()
timer.wait_time = 1.7
timer.auto_start = true
add_child(timer)
timer.timeout.connect(_on_timer_timeout)
func _on_timer_timeout():
randomize()
var coin = preload("path/to/your/coin.tscn").instantiate()
coin.position.y = -25 #Replace it by the top position of screen
coin.position.x = randf_range(-40, 40) #replace by start and end of screensize
add_child(coin)
When you paste this code in the script, press CTRL + S.
If you need far help from me as a friend then contact me on discord, king_game_developer