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

Help with Camera.Subject and Camera.Type?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

I made a Camera Script to where it spins around a part when you join. But I made this script that is below to when you press a gui button, the camera will be on your characters head. Does not work though. It stays spinning on the part.

script.Parent.MouseButton1Click:connect(function()
    local Player = game.Players.LocalPlayer
    local Char = Player.Character
    local Camera = game:GetService("Workspace").CurrentCamera   
    while wait() do

        if script.Parent.Parent.TextBox.Text == "a123" then
            Camera.CameraSubject = Char:WaitForChild("Head")
            Camera.CameraType = "Attach"
        elseif script.Parent.Parent.TextBox.Text ~= "a123" then
            Player:Kick("The code you have entered is wrong.")
        end
    end

end)

1 answer

Log in to vote
-1
Answered by 8 years ago

Try attaching it to a Humanoid, not the Head. Not sure, though.

Ad

Answer this question