Background: In this study, the purpose was to investigate the risk and protective factors affecting craving among patients with substance use disorders (SUDs) on buprenorphine, methadone, or opium maintenance treatment in Isfahan, Iran. Methods: In the current cross-section path analysis model, the statistical population was all SUD patients in Isfahan who were under treatment with Methadone or Buprenorphine in 2018. The study sample included 482 people who were on maintenance treatment in Isfahan who were selected by random sampling in two stages. The Franken, Hendriks, and Brink Opiate Craving Questionnaire (OCQ), Substance Related Beliefs Questionnaire (SRBQ), Cognitive Emotion Regulation Questionnaire (CERQ), Patient Health Questionnaire, Sixbey Family Resilience Assessment Scale (FRAS) and the Self-Resiliency Scale (SRS) were used to collect data. A path analysis method and PLS software were used to analyze the data. Results: The results showed that the direct impacts of self-resilience (β=-0.147, p = 0.009) and uncompromising strategies (β = 0.249, p = 0.0001) on depression are significant. Also, the direct effects of belief in drugs (β = 0.518, p = 0.0001) and depression (β = 0.219, p = 0.0001) on craving are significant. Conclusion: Substance-related beliefs play an essential role in craving both directly and indirectly. The results of the present study can be used to carry out educational and therapeutic interventions for drug SUD patients.