How would I go about scripting SCP-173?

For those who dont know:
SCP-173 is animate and extremely hostile. The object cannot move while within a direct line of sight. Line of sight must not be broken at any time with SCP-173. Object is reported to attack by snapping the neck at the base of the skull.

How would I do this in Roblox? Im having trouble thinking where to even begin.

4 Likes

My explanation will give you the basics, you can do this in multiple ways.
I assume you already got Peanut’s model, and know how to script.

Step 1: Base

  • First thing first, you want to make sure Peanut has a nice hitbox which covers up his entire body(this is mandatory).
  • Name it “HumanoidRootPart”.
  • Weld it to Peanut.
  • Make sure Peanut and HumanoidRootPart aren’t anchored.
  • Give Peanut a humanoid.
  • Run the game, and set the humanoid’s WalkToPoint property to something random.
  • If he is facing random orientations while moving, adjust the weld’s orientation until it’s fixed.
  • Add some sounds.
  • Play around with his health and walkspeed, then you’re done with this step!

Step 2: Scripting

I’m not really good with making bots or AI, but I’ll try my best.

Step 2.1: Definitions

  • Define Peanut and other stuff you’ve included.
  • Add control variables such as a Debounce, Target, LastSeenPosition etc. These will help you a lot.
  • I recommend you use helpful modules such as SimplePath and Roblox’s own AIUtilities module. You can find the second module on a Drooling Zombie model on the toolbox. You can also get other modules as your liking.
  • Check for close targets. You can use SimplePath’s GetNearestCharacter method and raycast for visibility, or straight up use Dot Product. Tutorial can be found here.

Step 2.2: Check Line Of Sight on Client

To detect if he is on your screen, or you have direct LOS with him, you can use 2 ways.

  • Dot Product again(not really handy in this scenario)
  • CurrentCamera:WorldToScreenPoint()

I have to be honest here; I’ve never used the CurrentCamera:WorldToScreenPoint() method before, nor know how to use it. But it looks WAAAAY more simple than Dot Product. A thread about this method can be found here. This is more client-friendly and you probably want to use this instead…
Add blinking too.
Use events or globals to make Peanut know if he is being observed or not.
To make him freeze upon LOS, either set his WalkSpeed to 0 or anchor his HRP.

Step 2.3: Chasing, Pursuing and Killing

If everything went right, your Peanut can find a target and know if he is in the LOS of someone. Lets make him follow someone and snappy snappy the necky.

Start a chasing sequence:

Chase and Pursue

  • Constantly check for visibility of target. While visible, save their position.
    • If target is no longer on visual, make Peanut go to the last known location.
    • Check for visibility. If Peanut sees the target again, keep chasing them and repeat this.
    • Otherwise if Peanut couldnt find the target, he would give up or go to somewhere relevant in hope of finding the target again. Or just make him give up right away. Your call.

Eliminate Target

  • Use the Humanoid.Touched event, check if the touched BasePart belongs to a Humanoid.
  • Or use Raycasting to see if a Humanoid is in the kill range.

  • After you are close enough to kill a target, set their health to 0 or anything else. You can also change the orientation of the “Neck” Motor6D(found under the Torso of the character, Head if said character is R15) to give a snapped neck effect. This has a chance of violating the Community Guidelines.

Conclusion

If everything went according to plan, you should have a functioning SCP-173. He can roam around, chase targets, pursue them on the loss of sight, and eliminate them.

I hope this helps you. Don’t hesitate to ask any questions.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.