View Player Script

Im trying to make an Admin Panel and I want a section where you can view/unview a player, but I do not know how to do this If somebody can show me how to do it or give me a script that does it, it would be appreciated.

Hey @V33S.

so id do it so you use CameraManipulation so like put the camera’s subject as the player?

1 Like

You can use the CameraSubject property of a player’s camera. Try setting it to the target player’s humanoid in your case.

3 Likes

Check out this; Camera | Roblox Creator Documentation & Camera | Roblox Creator Documentation. These should help you. I’d imagine you are using a button in a local script so in a local script i’d do

local Players = game:GetService("Players")
 local localPlayer = Players.LocalPlayer
-- unview is provided on devhub i believe
local function unview()
	if workspace.CurrentCamera and localPlayer.Character then
		local humanoid = localPlayer.Character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			workspace.CurrentCamera.CameraSubject = humanoid
		end
	end
end
local object = -- button
object.MouseButton1Click:Connect(function(unview)

Haha @kndn_v beat me to it.

3 Likes

To do view you’d put this also:

-- define the 'player' and set camera to player
workspace.CurrentCamera.CameraSubject = player