How to make enemy npc

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

i want something like this. Video timeline is 2:08 and 7:07 if want more details of what i want

  1. What is the issue? Include screenshots / videos if possible!

the issue is that i dont know how to detect that.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

i didnt find any solutions on the devforum or youtube.

i wonder if this is even possible…

2 Likes

I think this is a great answer you received on your previous post:

I would call it, combine multiple methods.

That video is not really descriptive for me. I see a guy walking towards the player and rising an arm… and some bars at the bottom left corner that I dont know what those means…

Whats the behaviour of that SCP?
Just describe exactly its behaviour and tackle each detail of it one by one.

I hardly think that basic stuff like that wont be possible on programming…

3 Likes

SCP-049 can stalk people and talk and the hardest part is i want to make him talk something different when his in different state. Like when he searching he will say “I know you’re in here” but when he spots the player he will say “Oh, there you are” and when he chases he will sprint

1 Like

Are you here? Hey?.. Pls answer.

1 Like

Thats actually the easy part. Just have a table of sounds per state, and choose a random one when the NPC is on that state to play it. The states can be fired depending on what is “stalk”

Thats ambiguous, what is “stalk” in terms of programming? Like, actively listening a player? listening when its close? seeking for nearby players based on sight and/or distance?


LOL, yeah, chill, answers could arrive over time from me and from other Devs xD

4 Likes

yes that what i mean also you can help with that?

1 Like

Yeah, currently I’m helping you clarify your ideas a bit first.

If you have clear ideas on each detail you want for your NPC, you can easily find a good approach in DevForum and tutorials out there.

Looking for something like: “Check distance between player and a specific position” will help you more than looking for “How to create SCP-049”…
Looking for “How to raycast as a NPC sight” will help more than “Make an SCP that can stalk you and talk bla bla”…

Idk if what I mean its understandable.

1 Like

but i dont know how to script i only know the basics not pathfinding and other

how do i make a table of sounds and make one of them play?

In that case. I suggest 2 approaches:

  • Start using toolbox models that maybe could do something similar to what you want

OR

  • Pause your project a little bit, and focus on learning the basics of scripting, instances in roblox engine, how the engine works, how scripting works.

Otherwise you will never be able to achieve the desired results for your SCP game. Trying to build a game when you dont understand how to script causes more headaches than learning to script first. Or do you want a cheap game with SCPs that looks like a cheap joke?

1 Like

i only have the model

but its hard to learn scripting for me

1 Like

Lets say you have 2 folders inside the SCP which holds some sound phrases. Then when you want to play a random one depending on the state you could:

local StalkPhrases = SPC.Stalk:GetChildren()
local AttkPhrases = SPC.Attk:GetChildren()

-- When SCP is stalking
StalkPhrases[math.random(1, #StalkPhrases)]:Play()

-- when scp is attaking or found a player
AttkPhrases[math.random(1, #AttkPhrases)]:Play()
1 Like

i was thinking about adding a folder but i didnt know that it will work

Learning to script is hard for everyone, even for geniuses I suppose…
Its kinda a choice you should take, if you really love game development, being brave and start learning. Or just give up, cause its not really important being able to build your dreams. Any choice is good, just grab one and go on.

1 Like

wait i have a question. when a function loops like maybe a function for searching players is it possible to make it play sound in the function one time and then wait cooldown and play it again if again searching?

Anything is possible on programming (almost everything).
I dont quite understand what you are asking for, this is what I get

  • A function that iterates all players in game
  • Per player found it will play a sound
  • Per player found and sound played, it should wait a certain cooldown before to continue with the next player

Thats what you are asking?

1 Like

yes and also will the searching folder play the choosed sound in the middle of the model? btw i called the folder like that

Yes, its perfectly possible, remember that almost everything is possible in programming… if it wouldnt how those amazing games would exist?..

This thread is getting a little offtopic, and we dont want to simply bump it over and over again with a conversation, if you have more doubts I would suggest send me a DM and I could help you further.

1 Like

DM where? ???