Everyones cameras Move when only one person interacts

In my game when you interact with the proximity prompt it changes your camera cframe but when we do it with multiple people it changes all of their cameras. How do we make it only affect that one person?

(Normal Script)

local ProximityPrompt = script.Parent.ProximityPrompt
local CamScene1 = game.ReplicatedStorage.CamScene1
local ReturnCam = game.ReplicatedStorage.ReturnCam
local Bridge = game.ReplicatedStorage.Bridge
local Cams = script.Parent.Parent.Parent.Cams

function StartConfigGui(player)
	local BottomMenu = player.PlayerGui:WaitForChild("BottomMenu")
	local Stat = player.PlayerGui:WaitForChild("Stats")
	local WorkshopGui = player.PlayerGui:WaitForChild("WorkshopGui")
	local WorkShopButtons = player.PlayerGui:WaitForChild("WorkshopButtons")

	BottomMenu.Enabled = false
	Stat.Enabled = false
	WorkShopButtons.Enabled = true
end

function EndConfigGui(player)
	local BottomMenu = player.PlayerGui:WaitForChild("BottomMenu")
	local Stat = player.PlayerGui:WaitForChild("Stats")
	local WorkshopGui = player.PlayerGui:WaitForChild("WorkshopGui")
	local WorkShopButtons = player.PlayerGui:WaitForChild("WorkshopButtons")

	BottomMenu.Enabled = true
	Stat.Enabled = true
	WorkShopButtons.Enabled = false
end

ProximityPrompt.Triggered:Connect(function(player)
	CamScene1:FireAllClients(Cams.Cam1.CFrame, player)
	StartConfigGui(player)
	script.Parent.Transparency = 1
	script.Parent.Transparency = 0.75
end)

Bridge.OnServerEvent:Connect(function(player)
	local WorkshopGui = player.PlayerGui:WaitForChild("WorkshopGui")
	ReturnCam:FireAllClients(player)
	EndConfigGui(player)
	WorkshopGui.Enabled = false
end)

It calls a camera move remote event

(Local Script)

local Camera = game.Workspace.Camera
local CamScene1 = game.ReplicatedStorage.CamScene1
local ReturnCam = game.ReplicatedStorage.ReturnCam
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local ProximityPrompt = game.Workspace.PCTEST.PC.Cover.ProximityPrompt
CamScene1.OnClientEvent:Connect(function(CamCFrame, player)
	Camera.CameraType = Enum.CameraType.Scriptable
	ProximityPrompt.Enabled = false
	TweenService:Create(Camera, Info, {CFrame = CamCFrame}):Play()
	game.Workspace[player.Name].Humanoid.WalkSpeed = 0
	for i,v in pairs(player.Character:GetDescendants()) do
		if v:IsA("BasePart") or v:IsA("Decal") then
			v.Transparency = 1
		end
	end
end)

ReturnCam.OnClientEvent:Connect(function(player)
	Camera.CameraType = Enum.CameraType.Custom
	ProximityPrompt.Enabled = true
	game.Workspace[player.Name].Humanoid.WalkSpeed = 16
	for i,v in pairs(player.Character:GetDescendants()) do 
		if v:IsA("BasePart") or v:IsA("Decal") then
			v.Transparency = 0
		end
	end
	game.Workspace[player.Name].HumanoidRootPart.Transparency = 1
end)

I think because you said:

FireAllClients()

1 Like

what should I do instead? because Im not sure

try using:

FireClient(player, Cams.Cam1.CFrame)

1 Like

I get an error: Unable to cast value to Object

Code: CamScene1:FireClient(Cams.Cam1.CFrame, player)

You need to do it like that:

FireClient(player, params)

1 Like

I get another error: Name is not a valid member of CFrame

Code: game.Workspace[player.Name].Humanoid.WalkSpeed = 0

This is not related but I don’t know what to do

change this line:

CamScene1.OnClientEvent:Connect(function(CamCFrame, player)

with this:

CamScene1.OnClientEvent:Connect(function(player, CamCFrame)

1 Like

I already did that but it did not work

did you get any errors???

1 Like

The same one: Name is not a valid member of CFrame

did u try fireClient? if you did what errors did you get?

That isn’t possible, but if that doesn’t work then I don’t know.

change this line:

CamScene1:FireClient(player, Cams.Cam1.CFrame)

with this:

CamScene1:FireClient(player, Cams.Cam1.CFrame, player)

1 Like

Error: TweenService:Create property named ‘CFrame’ cannot be tweened due to type mismatch (property is a ‘CoordinateFrame’, but given type is ‘Instance’)

Code: TweenService:Create(Camera, Info, {CFrame = CamCFrame}):Play()

try printing CamCFrame in your script

print(CamCFrame)

1 Like

it prints SuperEmeraldMaster1 which is me

change this:

CamScene1.OnClientEvent:Connect(function(player, CamCFrame)

with this:

CamScene1.OnClientEvent:Connect(function(CamCFrame, player)
1 Like