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

Help with camera mode?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

I want when I touch a part, the camera mode changes to "Classic"

game.Players.PlayerAdded:connect(function(player)
    script.Parent.Touched:connect(function(Touched)

    if player.Touched then

        local CameraMode = "Classic"



        end
    end)
end)

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
9 years ago

You need to change the property in the Player. To do this, we simply get the player that touched the part, like you already did, then access the CameraModeproperty. We'll add that in and use the variable "CameraMode" that you set to change it.


To do this, we'll change up the script a little bit to make sure that it changes for the player that touched it.

script.Parent.Touched:connect(function(Touched)
    local player = game.Players:GetPlayerFromCharacter(Touched.Parent)
    if player then
        player.CameraMode = "Classic"
    end
end)

And there you go! That's all there is to it.


Anyways, if you have any further problems/questions, please leave a comment below, and I'll see what I can do. Hope I helped :P

-Dyler3

0
Does not work. FiredDusk 1466 — 9y
Ad

Answer this question