So i have this local script and i wanna make so everyone in the server changes his camera
i tried with remotes and i still got nothing can someone explain me how to turn it so all the server sees his camera changing
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
repeat wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = workspace.camera1.CFrame
camera.FieldOfView = 60
player.Chatted:Connect(function()
if player.TeamColor == BrickColor.new("Maroon") then
camera.CFrame = workspace.camera2.CFrame
end
end)
script.Parent.OnServerEvent:Connect(function()
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
repeat wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = workspace.camera1.CFrame
camera.FieldOfView = 60
player.Chatted:Connect(function()
if player.TeamColor == BrickColor.new("Maroon") then
camera.CFrame = workspace.camera2.CFrame
end
end)
end)
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
repeat wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = workspace.camera1.CFrame
camera.FieldOfView = 60
player.Chatted:Connect(function()
if player.TeamColor == BrickColor.new("Maroon") then
camera.CFrame = workspace.camera2.CFrame
end
end)
Well i didnt separate it at all i just cut the code because i wanted to put on the OnServerEvent leaving the place where the code was empty and deleting the original place of it and put that firing event on another script this time a script not a local script, and maked a remote event on replicatedstorage and that remote event have the on server event script