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

Changing Player Camera Mode on Death?

Asked by 6 years ago

I have it were when you click a button it changes your camera mode but when you die i want it to reset the camera mode to free i have the script here which works in Studio but not in-game its a normal script in serverscriptservice and localscripts don't work!

game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
        player.CameraMode = 0
        end)
    end)
end)

1 answer

Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
6 years ago

http://wiki.roblox.com/index.php?title=API:Class/Player/CameraMode

Notes: This item should be used in a LocalScript to work as expected online.

Just do this in a localscript instead and it will work fine, you can just have one line in any local script which will automatically run when they die anyway

game.Players.LocalPlayer.CameraMode = 0
0
I mean on the Starter screen i want it to be off sturdy2004 110 — 6y
Ad

Answer this question