hi, guy who asked the banana package here, is it okay if i can let you code for my mod and use some npc scripts from your mods? i suck at coding npcs n all that, just wondering.
hey, sorry if all of this seems like alot, and i know this post is pretty old so you rpobabl-"will you just get to the point??" yeah sorry
so i need a script, that makes my character play a sound when he sees a player (kinda like playtime saing "lets play", except the sound shouldnt loop), play a sound while wondering, and a sound when he touches the player, speaking of which, i want him to chase the player when he sees them, i also need a cooldown so he wont just chase the player till the end of time, and i want that cooldown to start as soon as he touches the player, and obviously to make it possible to lose the character
Hello! I'm the guy who asked you for help with the grabby guy a few days ago. I recently restarted and rewrote pretty much of the code to look more like Playtime's, but instead of activating a jump rope you get dragged. Now that the script is cleaned up and more legible, do you think you could help me understand why he doesn't let go of the player?
First off, you need to make sure that there is a statement in the Update void, that says something like "if (Vector3.distance(base.transform.position, this.dragdestination) < 5) { this.dragging = false }. Have you done something like that yet?
I have an OnTriggerEnter void that's supposed to put him into a cooldown mode and make him let go of the player once he collides with the trigger in the center of the room, but I must've done something wrong because even when he is in the collider he doesn't let go or activate his cooldown.
Yes he has both and the room name is right. I think the issue is that he is always willing to interact with the player even when he is supposed to be in cooldown. How would I disable his collider when he is meant to be in cooldown?
So based on these other comments, do you just create working scripts for people? If so could I have a little help with a character of mine not working?
So the way the character works is that if he sees the player, he'll chase after them and then forcefully drag them to a room, similarly to how Mrs. Pomp works when angry. After getting to the room, the character lets you go and should be on a cooldown for about 15 seconds.
My main problem is that the character refuses to let go of the player, even when reaching the specified transform collider, and also does not seem to acknowledge or chase the player. Any help would be appreciated.
You need to have a separate boolean in your script that is set to true when he touches the player, and sets to false after he reaches the destination. If the boolean is set to false, then he will simply wander, but if it is set to true, then he will take the player somewhere.
Ok so I tried to make some changes to the code and now he won't interact with the player at all. Would it help if I shared the script I'm using so you could point out where I've gone wrong
You have to make it so that when the character's distance from the destination is less than 5, the dragging booleans are set to false. I'm not sure if it has something to do with the ps.isBase boolean, as you may want to replace it. This script is kinda long.
Can you make a script for a character called Foggy Copter, and he has multiple angles like 1st prize, and he wanders around and if he touches you, it becomes foggy for 30 seconds. Can you code that please?
Can you make a script for me? My character will be called Tattle Time, and if he sees you breaking any rules, he will tell principle and then the principle will be chasing you. Can you code that?
Hello, can you made an script for a character for me.
Mechanics: If you interact to it for the first time an Audio will play. If you give for him a quarter the sprite wont change but you will get an item and an audio will play.
Can you make a script that makes my character appear when you have 4 notebooks, and make it collect up to 2 notebooks before you can, and you need to get the notebooks back by using a bsoda on him, and then the notebooks appear next to each other where he as before you used the bsoda?
← Return to tutorial
Comments
Log in with itch.io to leave a comment.
hi, guy who asked the banana package here, is it okay if i can let you code for my mod and use some npc scripts from your mods? i suck at coding npcs n all that, just wondering.
Sure. If you want me provide you a script, simply ask.
do you have like, discord or smth? i can give you mines too, its deeznutsfan69
hey, sorry if all of this seems like alot, and i know this post is pretty old so you rpobabl-"will you just get to the point??" yeah sorry
so i need a script, that makes my character play a sound when he sees a player (kinda like playtime saing "lets play", except the sound shouldnt loop), play a sound while wondering, and a sound when he touches the player, speaking of which, i want him to chase the player when he sees them, i also need a cooldown so he wont just chase the player till the end of time, and i want that cooldown to start as soon as he touches the player, and obviously to make it possible to lose the character
I may make the script later
Thanks
Oh yeah, I'm just remembering to mention this now, but the character's name is "Jake", and the script is named "my script"
Hello! I'm the guy who asked you for help with the grabby guy a few days ago. I recently restarted and rewrote pretty much of the code to look more like Playtime's, but instead of activating a jump rope you get dragged. Now that the script is cleaned up and more legible, do you think you could help me understand why he doesn't let go of the player?
First off, you need to make sure that there is a statement in the Update void, that says something like "if (Vector3.distance(base.transform.position, this.dragdestination) < 5) { this.dragging = false }. Have you done something like that yet?
I have an OnTriggerEnter void that's supposed to put him into a cooldown mode and make him let go of the player once he collides with the trigger in the center of the room, but I must've done something wrong because even when he is in the collider he doesn't let go or activate his cooldown.
Does your character have a rigidbody, and a collider? If so, then you may want to re-check the name of the room trigger.
Yes he has both and the room name is right. I think the issue is that he is always willing to interact with the player even when he is supposed to be in cooldown. How would I disable his collider when he is meant to be in cooldown?
inside of the OnTriggerEnter script, make sure to add something like "this.dragcooldown <= 0" inside of the if statement.
So based on these other comments, do you just create working scripts for people? If so could I have a little help with a character of mine not working?
So the way the character works is that if he sees the player, he'll chase after them and then forcefully drag them to a room, similarly to how Mrs. Pomp works when angry. After getting to the room, the character lets you go and should be on a cooldown for about 15 seconds.
My main problem is that the character refuses to let go of the player, even when reaching the specified transform collider, and also does not seem to acknowledge or chase the player. Any help would be appreciated.
You need to have a separate boolean in your script that is set to true when he touches the player, and sets to false after he reaches the destination. If the boolean is set to false, then he will simply wander, but if it is set to true, then he will take the player somewhere.
Ok so I tried to make some changes to the code and now he won't interact with the player at all. Would it help if I shared the script I'm using so you could point out where I've gone wrong
Yes, please share it with me so I can help you better.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class YallEeverScript : MonoBehaviour
{
// Token: 0x0600030A RID: 778 RVA: 0x00016852 File Offset: 0x00014A52
private void Start()
{
this.agent = base.GetComponent<NavMeshAgent>();
this.audioDevice = base.GetComponent<AudioSource>();
this.Wander();
}
// Token: 0x0600030B RID: 779 RVA: 0x00016874 File Offset: 0x00014A74
private void Update()
{
if (this.coolDown > 0f)
{
this.coolDown -= 1f * Time.deltaTime;
}
if (this.warpCool >= 0f)
{
this.warpCool -= Time.deltaTime;
}
if (this.isDragging & this.playerTouched)
{
this.player.position = new Vector3(base.transform.position.x - 1f, 4f, base.transform.position.z);
this.agent.speed = 60f;
}
}
// Token: 0x0600030C RID: 780 RVA: 0x00016920 File Offset: 0x00014B20
private void FixedUpdate()
{
if (!this.ps.toBase)
{
Vector3 direction = this.player.position - base.transform.position;
RaycastHit raycastHit;
if (Physics.Raycast(base.transform.position, direction, out raycastHit, float.PositiveInfinity, 3, QueryTriggerInteraction.Ignore) & raycastHit.transform.tag == "Player" & (base.transform.position - this.player.position).magnitude <= 80f & this.warpCool <= 0f)
{
this.playerSeen = true;
this.TargetPlayer();
}
else if (this.playerSeen & this.coolDown <= 0f)
{
this.playerSeen = false;
this.Wander();
}
else if (this.agent.velocity.magnitude <= 1f & this.coolDown <= 0f)
{
this.Wander();
}
this.playerTouched = false;
}
if (this.warpCool <= 0f)
{
this.ps.toBase = false;
}
}
// Token: 0x0600030D RID: 781 RVA: 0x00016A58 File Offset: 0x00014C58
private void OnTriggerStay(Collider other)
{
if (other.tag == "Player" & !this.ps.toBase)
{
this.isDragging = true;
this.playerTouched = true;
this.agent.SetDestination(this.basePosition.position);
}
}
// Token: 0x0600030E RID: 782 RVA: 0x00016AAC File Offset: 0x00014CAC
private void OnTriggerExit(Collider other)
{
if (other.tag == "Player" & this.ps.toBase)
{
this.isDragging = false;
this.playerTouched = false;
this.Wander();
}
this.agent.speed = 15f;
}
// Token: 0x0600030F RID: 783 RVA: 0x00016AFC File Offset: 0x00014CFC
private void Wander()
{
this.wanderer.GetNewTargetHallway();
this.agent.SetDestination(this.wanderTarget.position);
this.agent.speed = 15f;
this.playerSpotted = false;
this.coolDown = 1f;
}
// Token: 0x06000310 RID: 784 RVA: 0x00016B9E File Offset: 0x00014D9E
public IEnumerator CollisionCooldown()
{
this.ps.toBase = true;
yield return new WaitForSeconds(this.warpCool);
this.ps.toBase = false;
yield break;
}
// Token: 0x06000311 RID: 785 RVA: 0x00016BB0 File Offset: 0x00014DB0
private void TargetPlayer()
{
this.agent.SetDestination(this.player.position);
this.agent.speed = 25f;
this.coolDown = 0.2f;
}
// Token: 0x06000307 RID: 775 RVA: 0x000167A0 File Offset: 0x000149A0
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
this.eever.audVal = Mathf.RoundToInt(Random.Range(0f, 1f));
base.StartCoroutine(this.GrabCool());
}
if (grabCollider = baseCollider)
{
this.isDragging = false;
this.playerSpotted = false;
this.playerTouched = false;
this.warpCool = 15f;
}
}
// Token: 0x06000308 RID: 776 RVA: 0x0001683B File Offset: 0x00014A3B
private IEnumerator GrabCool()
{
this.Hit.enabled = false;
yield return new WaitForSeconds(15f);
this.Hit.enabled = true;
yield break;
}
// Token: 0x0400039F RID: 927
public Collider Hit;
// Token: 0x040003A0 RID: 928
public YallEeverScript eever;
// Token: 0x040003A1 RID: 929
public Collider grabCollider;
// Token: 0x040003A2 RID: 930
public bool playerTouched;
// Token: 0x040003A3 RID: 931
public bool db;
// Token: 0x040003A4 RID: 932
public bool playerSeen;
// Token: 0x040003A5 RID: 933
public bool enemySeen;
// Token: 0x040003A6 RID: 934
public int audVal;
// Token: 0x040003A7 RID: 935
public Transform player;
// Token: 0x040003A8 RID: 936
public PlayerScript ps;
// Token: 0x040003A9 RID: 937
public Transform wanderTarget;
// Token: 0x040003AA RID: 938
public AILocationSelectorScript wanderer;
// Token: 0x040003AB RID: 939
public float coolDown;
// Token: 0x040003AC RID: 940
public float warpCool;
// Token: 0x040003AD RID: 941
public bool playerSpotted;
// Token: 0x040003AE RID: 942
private NavMeshAgent agent;
// Token: 0x040003B6 RID: 950
public AudioSource audioDevice;
// Token: 0x040003B7 RID: 951
public Collider baseCollider;
// Token: 0x040003B8 RID: 952
public bool isDragging;
public Transform basePosition;
}
You have to make it so that when the character's distance from the destination is less than 5, the dragging booleans are set to false. I'm not sure if it has something to do with the ps.isBase boolean, as you may want to replace it. This script is kinda long.
Can you make a script for a character called Foggy Copter, and he has multiple angles like 1st prize, and he wanders around and if he touches you, it becomes foggy for 30 seconds. Can you code that please?
Will the fog event from BB+ be in your game?
No, because the only tutorial I could find on it was hard to understand, and there was no video for it.
Ok
What to put in Agent and WanderTarget?
WanderTarget: AI_LocationSelector.
Can you make a script for me? My character will be called Tattle Time, and if he sees you breaking any rules, he will tell principle and then the principle will be chasing you. Can you code that?
There you go.
What to put in dest?
AI_LocationSelector
Can you make a script for me
if you get 2 exits baldi will appear and chase you fast but if he sees you look at him he will stop if you look away he will chase you
I hope you can do this
I can't make custom scripts for pre-existing original characters. Sorry.
Its fine I can ask redzils if he can because he made a creepypasta baldi mod named BASICS if you want to play it I'll send the game
https://gamebanana.com/mods/494365
Hello, can you made an script for a character for me.
Mechanics: If you interact to it for the first time an Audio will play. If you give for him a quarter the sprite wont change but you will get an item and an audio will play.
I hope you understand :D
Hello, sorry that I did not have time to create the script. I will be sure to create one soon.
https://www.mediafire.com/file/cqoo1dkf785qf1m/ADTestScript.cs/file
where can i find the AgentTest script?
You can find it in the scripts folder of your decompile
thank you for telling me
My character will be the Dorito Robot. It will be just like 1st prize, but it can leave behind zesty bars when moving. Can you make the code for it?
Not at the moment. I'm taking a break from developing right now.
Ok. I can wait.
Unfortunately, I am unable to make clones of items for Unity. Try suggesting something else.
How about 1st prize but gets stunned for 10 seconds when he bumps into a wall while he pushes you?
I'll try to make that work.
Can you make a script that makes my character appear when you have 4 notebooks, and make it collect up to 2 notebooks before you can, and you need to get the notebooks back by using a bsoda on him, and then the notebooks appear next to each other where he as before you used the bsoda?
I don't know who your character is. Also, try suggesting another idea that doesn't have to do with your character collecting notebooks.
ok
Cool tutorial better than every Gamebanana tutorial for characters!
toturial
Oh wait, nvmd you were correcting him.
Fixed.
delete using System; if you are using object or random
As I was saying, is it true that you were a former BBCCS contributor? If so, what did you contribute to that series?