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)

1 comment
Also, i'm not sure what's your purpose of checking if the player who clicked it has a humanoid because only players can click the GUI anyways, and yeah, it seems like you're doing this on a server script since you're using FireClient so use a local script for it instead..