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

How Do I put the players in first person when they reach a specific area? [closed]

Asked by 10 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

I haz no idea, mate..

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
botor2 0
10 years ago

It's actually quite simple, though it may not look it.

This script will only work if you have a block the player will touch when entering the area.

FP = false

function FirstPerson(hit)
    if hit.Parent:FindFirstChild("Humanoid") ~= nil then
        Person = hit.Parent.Humanoid
        if game.Players[Person.Parent.Name] ~= nil then
            if FP == false then
                FP = true
                game.Players[Person.Parent.Name].CameraMode = "LockFirstPerson"
            else
                FP = false
                game.Players[Person.Parent.Name].CameraMode = "Classic"
            end
        end
    end
end

script.Parent.Touched:connect(FirstPerson)

Put that in whatever block is detecting the player, and you're golden.

Ad