local Camera = workspace.CurrentCamera
local CameraPlayer = game.ReplicatedStorage.CameraValues.Player
CameraPlayer.Changed:Connect(function(plr)
if plr == game.Players.LocalPlayer.Name then
Camera.CameraType = Enum.CameraType.Scriptable
---Do whatever you want to type here.
end
end)
Is this there a better way of changing only one player’s camera? I found this on the forum but I’m not 100% sure it’s efficient.
The method I’m using is changing a player’s camera when they step on a part (Last time I tried using remote events, it gave me some error saying I can’t use remote events in workspace).
I’m not too sure what you mean by “change one persons camera.”
if you want it to switch when you touch a part, just use .Touched and change the camera on the client using a LocalScript. I don’t believe events are nessessary.
You don’t need to have the LocalScript in the workspace?
Put it in StarterCharacter / StarterPlayer and use a variable to reference the part you want to use .Touched on.
I might be wrong here, but this should work (someone correct me if I’m wrong). You can throw them all in a folder and if any of them are touched they will do the same thing.
for i, v in ipairs(workspace.Folder:GetChildren()) do
if v:IsA("Part") then
v.Touched:Connect(function()
--Code
end)
end
end