I have changed the script around and to make it easier to understand I will put all the script and describe the GUI parts and where the Remote Events are held.
The ScreenGui is called "CamOnDev" and contains a "Frame" in it. In that frame it contains 2 text boxes, "Enable" and "Disable", a TextBox called "pname" and a text label that doesnt appear in the scripts, The screen gui is in Replicated Storage and a script in ServerScriptService controls what players get the gui, The script is pasted below.
GUI Giver: (Script)
game.Players.PlayerAdded:Connect(function(plr)
if plr.Name == "Eletrinn" then
local gui = game.ReplicatedStorage["CamOnDev"]:Clone()
gui.Parent = plr.PlayerGui
end
end)
The Remote Events called "CamAll" and "DisableCamAll" is also held in ReplicatedStorage. The script that controls these are in ServerScriptService and the code is pasted below
Remote Event Script: (Script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CamAll = ReplicatedStorage:WaitForChild("CamAll")
local DisableCamAll = ReplicatedStorage:WaitForChild("DisableCamAll")
local gui = game.Players:WaitForChild("Eletrinn").PlayerGui.CamOnDev.Frame
gui.Enable.MouseButton1Click:Connect(function()
CamAll:FireAllClients()
end)
gui.Disable.MouseButton1Click:Connect(function()
DisableCamAll:FireAllClients()
end)
The Final scripts are located in StarterPlayerScripts and have the "Enable" script, for the enable button in the gui and the "Disable" script for the disable button in the gui. Both scripts are pasted below.
Enable script: (Local Script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DisableCamAll = ReplicatedStorage:WaitForChild("DisableCamAll")
local CamAll = ReplicatedStorage:WaitForChild("CamAll")
local cam = workspace.CurrentCamera
local CamPart = game.Workspace.CamPart
Disable = true
DisableCamAll.OnClientEvent:Connect(function()
Disable = false
end)
CamAll.OnClientEvent:Connect(function()
Disable = true
local gui = game.Players:WaitForChild("Eletrinn").PlayerGui.CamOnDev.Frame
local FocusPart = game.Workspace:WaitForChild(gui.pname.Text).UpperTorso
print("Cam Enabled.")
while Disable == true do
cam.CameraType = Enum.CameraType.Scriptable
cam:Interpolate(CamPart.CFrame, FocusPart.CFrame, 0.5)
gui.Enable.Visible = false
gui.Disable.Visible = true
wait(0.2)
end
end)
Disable script: (Local Script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DisableCamAll = ReplicatedStorage:WaitForChild("DisableCamAll")
local cam = workspace.CurrentCamera
DisableCamAll.OnClientEvent:Connect(function()
local gui = game.Players:WaitForChild("Eletrinn").PlayerGui.CamOnDev.Frame
print("Cam Disabled.")
cam.CameraType = "Custom"
gui.Disable.Visible = false
gui.Enable.Visible = true
end)
What happens is when I type in the name of the player in the gui TextBox it finds that players Upper Torso and should put everyone in the servers cameras looking towards the players upper torso from the "CamPart" which is just a part in the workspace. But what happened is I joined with my main account and my alt on the roblox app, and typed in the name of the player I want focused on and clicked the enable button but it only affected my camera and not anyone else's. I hope that is enough information to help solve the issue I am having and I hope to hear from you soon.

2 comments
This can be cause by changing GUI in server
How do I fix this?