How would I activate a local script that changes the camera in starterplayerscript from a server script?

I have a round based game but I also have a local script in starter player script and the main server script that I want to undisable the local script thanks, Here are my scripts:

local status = game.ReplicatedStorage.Values.IsInRound
local status2 = game.ReplicatedStorage.Values.CameraChanger
local Event = game.ReplicatedStorage.Events.HeliMover
local Sound = game.Workspace.Helicopter
local ingame = game.ServerStorage.Heli.Helecopter:Clone()
	
	ingame.Parent = game.Workspace
	ingame:MoveTo(Vector3.new(276.5, 71.5, -786))
	wait(2)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -808)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -681.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -591.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -489)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -396)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -286.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 78.5, -167.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 43, -167.5)))
	wait(45)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, -167.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, -77.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, -77.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, -38)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 93.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 93.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 163.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 231)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 313.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 392.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 496.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 496.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 690)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 797.5)))
	wait(1.3)
	ingame:SetPrimaryPartCFrame(CFrame.new(Vector3.new(265, 100.5, 881.5)))
	game.StarterPlayer.StarterPlayerScripts.CameraChanger.Disabled = false
	wait(20)
	game.StarterPlayer.StarterPlayerScripts.CameraChanger.Disabled = true
	status2.Value = true
	wait(20)
	ingame:Destroy()
	print("COMPLETED HELICOPTER FLIGHT!")
	if game.Workspace.Helicopter.IsPlaying then
		Sound:Pause()
		print("Sound Paused!")
	end

This script just moves a helicopter model I have but I at the end I want the local script to be acivated

Here is the local script:

wait(5)

print("Script Is Starting!")

local cam = game.Workspace.CurrentCamera

local player = game.Players.LocalPlayer

local FocusPart = game.Workspace.CameraFocus

local EndPoint = game.Workspace.EndPoint

wait(3)

print("Changing Camera!")

cam.CameraType = "Scriptable"

cam:Interpolate(FocusPart.CFrame, EndPoint.CFrame, 2)

wait(10)

cam.CameraType = "Custom"

Thanks

You can use a remote function, I would not use personally due to it not being too stable though. RemoteFunction
also you should use task.wait() instead of wait()

1 Like

You will just need a remote event to fire from the server to the client.

See here on how to set it up:
https://developer.roblox.com/en-us/api-reference/class/RemoteEvent

1 Like