Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera minipulation help?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

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

Log in to vote
0
Answered by 9 years ago

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
Ad
Log in to vote
0
Answered by 9 years ago

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

0
Remove is depricated, use destroy. HungryJaffer 1246 — 9y
0
Just an example m8 docrobloxman52 407 — 9y

Answer this question