Jumpscare defining the player

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!
    what the jumpscare to work with the player
  2. What is the issue? Include screenshots / videos if possible!
    cant deining the player correctly as the piggy humanoid is cloned into a different player each round

This is an example of the code the issue is that you need to define the jumpscare point in the piggy for example however this is cloned with the player. The jumpscarepoint are in the player but i cant script it to scroll through the plyers and fine piggy.

local jumpscaring = false
local tweenService = game:GetService(“TweenService”)
local jumpscareTime = 2
local point1 = workspace.Piggy.JumpscarePoint1
local point2 = workspace.Piggy.JumpscarePoint2
local jumpscarePiggy = workspace.Piggy
local jumpscareAnim = jumpscarePiggy.Jumpscare
local cc = workspace.CurrentCamera
game.ReplicatedStorage.Jumpscare.OnClientEvent:Connect(function()
cc.CameraType = Enum.CameraType.Scriptable
cc.CFrame = point1.CFrame
jumpscaring = true
jumpscarePiggy.Humanoid:LoadAnimation(jumpscareAnim):Play()
script.JumpscareSound:Play()
coroutine.wrap(function()
repeat
tweenService:Create(workspace.CurrentCamera,TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),{CFrame = point2.CFrame,}):Play()
wait(0.1)
tweenService:Create(workspace.CurrentCamera,TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),{CFrame = point1.CFrame,}):Play()
wait(0.1)
until jumpscaring == false
end)()
task.wait(jumpscareTime)
script.JumpscareSound:Stop()
jumpscaring = false
cc.CameraType = Enum.CameraType.Custom
if game.Players.RespawnTime >= jumpscareTime then
cc.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end
end)

Please format your code properly before posting. The devforum tells you how to do this. Use three of these characters: `
Followed by another three to close the code block.

Hi thank you for you help👍 this was very helpful I appreciate your input