I wrote this script to try and close the guis that were previously open and switch the player to a camera. I've been trying to fix this and I can't figure out why it won't switch the player to the cam.
local hats = script.Parent.Parent script.Parent.MouseButton1Down:connect(function(click) if click.Parent:FindFirstChild("Humanoid") then hats.Visible = false hats.Parent.Outfits.Visible = false local player = game.Players:GetPlayerFromCharacter(click.Parent) game.ReplicatedStorage.TriggerCamE:FireClient(player) end end)
It is to my knowledge that the server can't edit the players camera, only the player. I may be wrong but I'd give it a shot.
The line where you wrote Click.Parent, wouldn't work since the the parameter of MouseButton1Down does not include anything that's part of the character model.
https://developer.roblox.com/en-us/api-reference/event/GuiButton/MouseButton1Down
local hats = script.Parent.Parent local player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() hats.Visible = false hats.Parent.Outfits.Visible = false game.ReplicatedStorage.TriggerCamE:FireServer() end)