Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Since GameBanana doesn't let me post the script, I have to post this in this website.
- Remember, I don't use these scripts. If you have any bugs, tell me or BaldiaBsicsFan.
- Follow directions from the comments. Comments begin with //
- */
- // For the BsodaEffectScript
- // Add this on the OnTriggerStay function
- if (other.name == "Gum" & gameObject.name != "Beans")
- {
- if (other.transform.position.y <= 0f)
- {
- other.transform.position = new Vector3(transform.position.x, 0f, transform.position.z);
- return;
- }
- other.GetComponentInChildren<SpriteRenderer>().sprite = BeansScript.spriteNPCGum;
- other.GetComponent<BsodaSparyScript>().speed = 0f;
- UnityEngine.Object.FindObjectOfType<BeansScript>().SorryNPC();
- other.transform.position = new Vector3(transform.position.x, 0f, transform.position.z);
- otherVelocity = base.transform.forward * agent.speed * 0.05f;
- Object.Destroy(other.gameObject, 10f);
- inBsoda = true;
- failSave = 10f;
- }
- // For the PlayerScript
- // Add this on the OnTriggerStay function
- if (other.name == "Gum" && other.GetComponentInChildren<SpriteRenderer>().sprite != BeansScript.spriteNPCGum)
- {
- StartCoroutine(Stucked());
- Object.Destroy(other.gameObject, 0f);
- UnityEngine.Object.FindObjectOfType<BeansScript>().SorryPlayer();
- }
- // End of the OnTriggerStay function
- // Add this variable to the script
- public GameObject gumScreen; // The gum on the hud when hit.
- // Make sure System.Collections is defined, then add this.
- private IEnumerator Stucked()
- {
- gumScreen.SetActive(true);
- walkSpeed -= 8f;
- runSpeed -= 8f;
- playerSpeed = walkSpeed;
- yield return new WaitForSeconds(10f);
- walkSpeed += 8f;
- runSpeed += 8f;
- playerSpeed = walkSpeed;
- gumScreen.SetActive(false);
- yield break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement