Script problem: camera movement for every player on event

I want to make a camera focus on a character model when a scene is playing but I also want to make it happen for everyone when one person presses a proximity part

The issue is that the camera only moves for the one who triggered the proximity, i am confused how to have the camera pan for everyone

I have 2 scripts, one in the dialog gui, the other in starter player

I cant figure out the problem, i have no idea what to search. Ive been trying for an hour struggling to get it working because i dont know how to test problems with multiplayer.

Dialog gui script (server script):

local frame = script.Parent.Parent
local textLabel = script.Parent
local pp = game.Workspace.TestNoob:WaitForChild("Torso").Talk
local talking = false
local talkspeed = 0
local sfx = frame.Beep
local ended = false

frame.Position = UDim2.new(0.131, 0, 1, 0)

local RS = game:GetService("ReplicatedStorage")
local trigger = RS.TestCameraTrigger
local endtrigger = RS.TestCameraEnded

pp.Triggered:Connect(function(player)
	pp.Enabled = false
	frame.Visible = true
	ended = false
	trigger:FireClient(player)

	frame:TweenPosition(
		UDim2.new(0.131, 0, 0.579, 0),
		"Out",
		"Back",
		0.5,
		false
	)

	wait(0.5)

	local text1 = "Example text"
	
	talking = true
	talkspeed = 0.05
	for i = 1, #text1 do
		textLabel.Text = string.sub(text1, 1, i)
		wait(0.05)
	end
	talking = false

	wait(0.5)

	local text2 = "Example text"
	
	talking = true
	talkspeed = 0.05
	for i = 1, #text2 do
		textLabel.Text = string.sub(text2, 1, i)
		wait(0.05)
	end
	talking = false

	wait(0.5)

	local text3 = "Example text"

	talking = true
	talkspeed = 0.07
	for i = 1, #text3 do
		textLabel.Text = string.sub(text3, 1, i)
		wait(0.07)
	end
	talking = false

	wait(0.7)

	local text4 = "Example text"

	talking = true
	talkspeed = 0.2
	for i = 1, #text4 do
		textLabel.Text = string.sub(text4, 1, i)
		wait(0.2)
	end
	talking = false
	
	wait(0.5)
	
	frame:TweenPosition(
		UDim2.new(0.131, 0, 1, 0),
		"InOut",
		"Sine",
		0.5,
		false
	)
	
	wait(0.5)
	
	frame.Visible = false
	pp.Enabled = true
	textLabel.Text = ""
	ended = true
	endtrigger:FireClient(player)
end)

-- {0.131, 0},{1, 0} starting

-- {0.131, 0},{0.579, 0} finishing

while wait() do
	if talking == true then
		wait(talkspeed)
		sfx:Play()
	end
end

Starter player script (local script):

local camera = workspace.CurrentCamera
local testtarget = workspace:WaitForChild("CameraPanTest")
local TS = game:GetService("TweenService")
local RS = game:GetService("ReplicatedStorage")
local trigger = RS.TestCameraTrigger
local endtrigger = RS.TestCameraEnded

trigger.OnClientEvent:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable

local tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false)

TS:Create(camera, tweeninfo, {CFrame = testtarget.CFrame}):Play()

	endtrigger.OnClientEvent:Connect(function()
		camera.CameraType = Enum.CameraType.Custom
	end)
end)

I would be grateful if anyone tried to help

Proximity Prompts only trigger for the player only. In that case, I would recommend using your own trigger system on a script.

Maybe try using :FireAllClients()

Instead of
trigger:FireClient(player)

Use
trigger:FireAllClients()

Let me know if this works for you.

Yes! It worked. Thanks alot for yall’s help

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