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…
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
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
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”…
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?
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()
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.
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?
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.