Auto fgw with reset item

how to make auto fgw
i made script inside fgw
but need it after finghing it use reset fgw time and use fgw crystal then teleport inside and use my script
how to do it
thanks