In my game, when a player steps on a certain part, it triggers a cutscene however I'd like it to only play for the player who steps on the part but instead the cutscene plays for everyone?
Cutscene trigger script:
-- localscript in starterGui
local db = false
local player = game.Players.LocalPlayer
local TweenService = game:GetService("TweenService")
local cam = workspace.CurrentCamera
local TouchPart = game.Workspace.MORPH.Head -- Change this to the part you want to be touched
function play(char)
wait(1)
if db == false then
db = true
local PP = char.PrimaryPart
cam.CameraType = Enum.CameraType.Scriptable
local BCFrame = PP.CFrame * CFrame.new(0,0,-3) * CFrame.new(0,math.pi,10)
local targetCFrame = PP.CFrame * CFrame.new(0, 0, -12) * CFrame.Angles(0, math.pi, 0)
cam.CFrame = BCFrame
local tween = TweenService:Create(
cam,
TweenInfo.new(13),
{CFrame = targetCFrame}
)
tween:Play()
tween.Completed:Wait()
cam.CameraType = Enum.CameraType.Custom
wait(10)
db = false
end
end
TouchPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then -- checking if the object that touched it is a player
play(hit.Parent) -- plays the animation
end
end)
-- This event below will run when the player is added. Delete it all if you do not want this!
player.CharacterAdded:Connect(function(character)
wait(3)
play(game.Players.LocalPlayer.Character)
end)

7 comments
The cutscene still seems to play for everyone in the server ;/
lemme see
try again now
so did it work?
Yes, thank you it worked.
np
who downvoted