Advertisement
JohnsterSpaceProgram

Principal Ban-ER Item Script (BFNS Baldi Mod)

Jan 6th, 2020
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. //Pickup Script
  2.  
  3. else if (raycastHit.transform.name == "Pickup_PrincipalBanner" & Vector3.Distance(this.player.position, base.transform.position) < 10f)
  4. {
  5. raycastHit.transform.gameObject.SetActive(false);
  6. this.gc.CollectItem(12);
  7. }
  8.  
  9. //Gamecontroller Script
  10.  
  11. else if (this.item[this.itemSelected] == 12) // Principal Banner Code
  12. {
  13. StartCoroutine(PrincipalBanner());
  14. this.ResetItem();
  15. }
  16.  
  17. IEnumerator PrincipalBanner()
  18. {
  19. float timer = 45f;
  20. this.principal.SetActive(false);
  21. this.bannedicon.SetActive(true);
  22. this.audioDevice.PlayOneShot(this.banned);
  23. Debug.Log("Principal has been banned!");
  24. while (timer > 0)
  25. {
  26. timer -= Time.deltaTime;
  27. yield return new WaitForEndOfFrame();
  28. }
  29. Debug.Log("Principal has been unbanned! Welcome back!");
  30. this.principal.SetActive(true);
  31. this.bannedicon.SetActive(false);
  32. this.audioDevice.PlayOneShot(this.hebackpri);
  33. }
  34.  
  35. public GameObject bannedicon;
  36. public AudioClip banned;
  37. public AudioClip hebackpri;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement