Changing FOV by pressing U not working

So, im trying to make it so that, if you press U, you field of changes, but the script won’t work…

My script is Script located in workspace

local UserInputService = game:GetService("UserInputService")

local player = game:GetService("Players")

local client = player.LocalPlayer
local camera = workspace.CurrentCamera

UserInputService.InputBegan:Connect(function(input, GameProcessed)
	
	if input.KeyCode == Enum.KeyCode.U then
		 camera.FieldOfView = 100
		wait(1)
	end
	
end)

LocalPlayer isn’t accessible on the server. Try using a local script instead.

put the localscript inside starterpack too

First of all, this should be a Local Script, not a script, since you’re dealing with inputs and the player’s camera. Second of all, local scripts won’t execute the code in it if it’s a descendant of the workspace, with the only exception being if it is a descendant of a player’s character

Put the script in StarterCharacterScripts or StarterPlayerScripts. StarterPack can also work

Try making it a LocalScript and placing it in StarterPlayerScripts