How can I make this jumpscare only show for the player who triggered it?

So I have this script where when a player enters/ touches the triggered part; the jumpscare happens. The video is below


This is the screen that shows but it shows up for every player in the server when a player walks in the trigger part.


This script is in the ServerScriptService & you can see what the script is doing.


This is a local script that is in StarterCharacterScript.

I would appreciate any responses as im not experienced with scripting as much :pensive: Thank yall

  • Clone the monster from the client (local script) rather than on the server script
  • Fire the events to the specific player using :FireClient instead of all clients (:FireAllClients)
1 Like

hiya! tysm for getting back. I tried what you suggested but all that happens is the monster does appear but doesnt destroy & the camera doesnt tween :fearful:

You’ll also have to destroy the monster on the client as well. As for the camera tween, are you certain that you’re passing in the Player argument? :FireClient requires a Player object to know which client the signal should be directed to.

local Players = game:GetService("Players")
local hitPlayer = Players:GetPlayerFromCharacter(hit.Parent)

event:FireClient(hitPlayer, ...)
1 Like

hey sorry for the major late response! I would add those lines in the server script?

Correct, though you would need to modify…

event:FireClient(hitPlayer, ...)

because it is just an example. When firing with :FireClient, Player is the first argument, and then any other arguments you wish to send to be received follow after it.

This is how I got the server script looking


.
.
.
.
.
.
.
And this is how the local script is looking.

.
.
.
.
This works & it doesnt trigger any other players camera. Only the player that touches the triggered part but now it seems only one player can touch the part and thats it.

Basically only one player can touch and when I tried to touch it again on my alt it didnt trigger the event

nevermind. I fixed the issue :smiley: I added my local alreadyPlayed to the local script and everything works fine! I appreciate your help alot

Actually I do have one more question. I have a jumpscare animation in my monster. How would I play that animation when the event is triggered?

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