I'm having trouble trying to change the camera back to Classic once you die. Can someone help me fix my script?
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild('Humanoid').Died:connect(function() local player = game.Players.LocalPlayer player.CameraMode = "Classic" end) end) end)
FilteringEnabled is stipping you from doing what you want to do.. You're going to have to either setup a RemoteEvent to do this for you, or do everything on the client.
Place a RemoteEvent in ReplicatedStorage, use FireClient
on the server, and OnClientEvent
on the client. Do any camera manipulation on the client.
Script in ServerScriptStorage;
local death = game.ReplicatedStorage.Died --This is the RemoteEvent game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild('Humanoid').Died:connect(function() death:FireClient(player) end) end) end)
LocalScript in StarterPack;
local player = game.Players.LocalPlayer local re = game.ReplicatedStorage.Died re.OnClientEvent:Connect(function() player.CameraMode = "Classic" end)
If you do everything on the client, there's no need to setup a RemoteEvent. Place a LocalScript in StarterPack;
local plr = game.Players.LocalPlayer repeat wait() until plr.Character local char = plr.Character local hum = char:WaitForChild("Humanoid") hum.Died:Connect(function() player.CameraMode = "Classic" end)