When I change the CurrentCamera of a player, everyone in the entire server’s camera is changed. Here is the script:
game.ReplicatedStorage.Events.OpenShop.OnClientEvent:Connect(function()
local playerGui = script.Parent
local camera = workspace.CurrentCamera
if playerGui.Shop.Opened.Value == false then
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = workspace.Shop.Cameras.CamPart1
camera.CFrame = workspace.Shop.Cameras.CamPart1.CFrame
game.ReplicatedStorage.Events.AddCam:FireServer()
for i, v in pairs(playerGui:GetChildren()) do
if v.ClassName == "ScreenGui" then
v.Enabled = false
end
end
end
playerGui.Shop.Enabled = true
end)
The for loops just get rid of the rest of the UI when it is fired. This is also a LocalScript meaning that it shouldn’t (at least I am aware of) change the server unless it is an animmation I am pretty sure.
I would personally be doing this on the client side,
Since this CurrentCamera is being accessed from the server I’m going to assume this is probably the cause of what’s making it edit everyones camera. I would do some research though to see if theirs already a solution. Camera | Documentation - Roblox Creator Hub
I found some text saying: " Each client’s particular Camera object can be accessed through the Workspace.CurrentCamera property of the Workspace on that client."
This what I did and I did it through a LocalScript.
script.Parent.Touched:Connect(function(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if (human~=nil) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.ReplicatedStorage.Events.OpenShop:FireClient(player)
end
end)
Can you go to Workspace, and inside Workspace’s properties, scroll down until you find the filtering enabled property.
Is it checked or unchecked? If it’s unchecked, that’s your problem. Filtering Enabled was added so that exploiters can’t exploit the server. Without this, a change a client made would be seen by the whole server!
This also means changes made by LocalScript’s can be seen by everyone.