How do you change multiple players cameras?

How do you change multiple players cameras in a script?

I’m making a game where you basically stare at someone and I’m adding staring contests.

To start the game, your camera gets locked staring at a player, but once someone challenges you to a staring contest, and you accept, I want both players cameras to change to a different scene.

Right now I only have it so one players camera changes. Idk how to make the others camera change.

Any and all help is appreciated. Thanks!

1 Like

maybe make a event? so it does this process to everyone when this event is triggered

Here is what I mean :wink:
https://www.google.com/search?q=roblox+event+tutorials&rlz=1C1VDKB_enUS933US933&oq=roblox+event+tutorials&aqs=chrome..69i57j0i22i30j0i390l4.4651j0j7&sourceid=chrome&ie=UTF-8#kpvalbx=_G2KqYvVpopmvvA_Iv6-YCg23

1 Like

What causes the one player’s camera to change scenes, but not the others? More context here would help

1 Like

It’s because it’s when the player clicks the accept button, then their camera changes. I’m just not sure how to get the other player and change their camera position.

for i, v in pairs(ChallengeFrame) do
		if v:IsA("TextButton") then
			if v.Name == "Accept" then
				v.MouseButton1Click:Connect(function()
					
					local Frame = v.Parent

					local Accepter = player.Name
					local Challenger = v.Parent.Name

					game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("AcceptChallenge"):FireServer(Accepter, Challenger)
					
					local Camera = workspace.CurrentCamera
					
					local SetCamera = function()
						Camera.CameraType = Enum.CameraType.Scriptable
						Camera.CFrame = CFrame.new(0, -32.5, -15)
					end

					Camera:GetPropertyChangedSignal("CameraType"):Connect(SetCamera)
					SetCamera()
					
					Frame:Destroy()
					
					local UserId = game:GetService("Players"):GetUserIdFromNameAsync(Challenger)

					if UserId then

						local Model = game:GetService("Players"):CreateHumanoidModelFromUserId(UserId)

						if Model then

							for i, char in pairs(workspace:WaitForChild("ChallengeBox"):WaitForChild("Player"):GetChildren()) do
								char:Destroy()
							end
							
							Model.PrimaryPart = Model:WaitForChild("HumanoidRootPart")
							Model.PrimaryPart.CFrame = CFrame.new(0, -33, -23)
							Model.PrimaryPart.Orientation = Vector3.new(0, 180, 0)
							Model.PrimaryPart.Anchored = true
							Model:WaitForChild("Humanoid").DisplayDistanceType = "None"
							Model.Parent = workspace:WaitForChild("ChallengeBox"):WaitForChild("Player")
						end
					end
				end)
			end
		end
	end 
end
1 Like