Hi! So I'm extremely new to scripting, however I've started creating a few games recently and I want to go beyond the simplicity of putting together some models. The games I'm creating mainly focus on the horror category, and so far I think I've done a decent job for a beginner. Currently I'm in the middle of creating a new game. I've made a map and all but I was wondering how I could create a jumpscare.
To be more specific, say if a player were to click a button, or simply step on an object, I was wondering how I could script a timed event that when completed will make a model pop up in front of them, as well as when this specific object is interacted with, will play a sound. I'm sure it will help give my game a little credit, since for the most part the games I've created so far are just ambiance, nothing too scary. Thanks!

2 comments
Thanks! However when I tried running this script with the instructions given it wouldn't work, and there was an error: 12:57:38.444 - Workspace.PrimaryPart.Script:13: attempt to index field 'PrimaryPart' (a nil value) I can't seem to find a way to fix it.
You have to set the PrimaryPart in the properties of the model.