I'm trying to make a round based game where it teleports players to the round and back. When they are in the round it should turn them to first person (using LockFirstPerson), but it doesn't work or print any errors in the output? I also used the print method to find out the code where the error starts, and it didn't print anything.
(InRound is a bool value that changes when the player enters the round)
This is also a local script. I tried it out as a server script as well and it still didn't work.
local InRound = game.ReplicatedStorage.InRound local Plr = game.Players.LocalPlayer if InRound.Value == true then Plr.CameraMode = Enum.CameraMode.LockFirstPerson end if InRound.Value == false then Plr.CameraMode = Enum.CameraMode.Classic end
The reason it wouldn’t work is because the function isn’t always running, it only occurs as soon as they join the game. Here is a script to help you out:
local InRound = game.ReplicatedStorage.InRound local Plr = game.Players.LocalPlayer InRound:GetPropertyChangedSignal("Value"):Connect(function() if InRound.Value == true then Plr.CameraMode = Enum.CameraMode.LockFirstPerson elseif InRound.Value == false then Plr.CameraMode = Enum.CameraMode.Classic end end)
Sorry about the formatting, I typed it on mobile but it should still work.