Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Camera minipulation help?

I am not sure how to get the players head. I need help, thanks! Its in local script in startergui

player = game.Players.LocalPlayer
for i, player in ipairs (game.Players:GetChildren()) do
local target = player.Character.Head
local camera = game.Workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target

local angle = 0
local i = 0
 
	while wait() do
	    camera.CoordinateFrame = CFrame.new(target.Position)
							+ CFrame.Angles(0, angle, 0)
							+ CFrame.new(0, 1, 100)
	    angle = angle + math.rad(1)
	 
		i = i + 1
		if i > 1000 then break end	
	end
end

2 answers

When you wrote local target = Player.Parent.Head, you were telling the script to look for the head in game.Players. Instead, look for the head inside the player's character model. The easiest way of doing this is:

local target = Player.Character.Head

You have to loop through all the players then get their heads like:

for i, player in ipairs (game.Players:GetChildren()) do
	player.Character.Head:remove() -- or what ever you wanna do with it
end

Hope it helps

2 comments

0

Remove is depricated, use destroy.

0

Just an example m8

This discussion is preserved as it was. New answers, comments, and votes are closed.