Field Of View Remote Event Tween Not Working

hey i making a a tool where the player gains speed when used but im having an issue. i created a remote event to tween the players field of view when used but it doesn’t seem to work? why is this? the prints dont run so im assuming the server never sends the signal to fire the remote event, only thing is that it does fire the client.

– server

remoteEvent.OnServerEvent:Connect(function(player)

	
	if player:GetAttribute("IsRunning") then return end
	
	local backpack = player.Backpack

	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChild("Humanoid")
	
	local loadedAnimation = humanoid:LoadAnimation(anim)
	
	local normalWalkspeed = humanoid.WalkSpeed
	local normalWalkJump = humanoid.JumpPower
	
	local adrenalatiedWalspeed = humanoid.WalkSpeed * 1.7
	local adrenalatiedJump = humanoid.JumpPower * 1.7
	
	local rightArm = character:FindFirstChild("Right Arm")
	
	loadedAnimation:Play()
	
	loadedAnimation.Stopped:Wait()
	
	local bdattach = tool.bodyAttach
	
	humanoid:UnequipTools()

	repeat task.wait() until tool.Parent == backpack
	
		task.wait(0.05)


		for _, weld in ipairs(bdattach:GetChildren()) do
			if weld:IsA("Weld") then
				weld:Destroy()
			end
		end

		tool.Parent = workspace

		debris:AddItem(tool, 10) 

		print("nice")
	
	cameraEvent:FireClient(player, 100)
	
	humanoid.WalkSpeed = adrenalatiedWalspeed
	humanoid.JumpPower = adrenalatiedJump
	
	task.wait(7)
	
	cameraEvent:FireClient(player, 70)

	humanoid.WalkSpeed = normalWalkspeed
	humanoid.JumpPower = normalWalkJump
	
end)
-- client 

local cameraEvent = tool:WaitForChild("cameraEvent")



local tweenService = game:GetService("TweenService")
local twi = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false)


cameraEvent.OnClientEvent:Connect(function(amount)
	local camera = game.Workspace.Camera

	camera.CameraType = Enum.CameraType.Scriptable

	warn("BEFORE" .. camera.FieldOfView)
	local cameraTween = tweenService:Create(camera, twi, {FieldOfView = amount}):Play()
	
	warn("NOW" .. camera.FieldOfView)
end)
1 Like

I’m a bit confused. You said the prints don’t run, so you’re assuming that the server doesn’t fire the event, but the client is being fired? Can you elaborate on that, please? Also, which prints aren’t running, the ones on the client, or the ones on the client and server?

the client prints do not run however the server does not give any errors and the rest of the server script workers fine except the camera tween event.

I see. And where is the localscript parented? Also, you shouldn’t set the camera type to Scriptable in this context, as FieldOfView can be changed regardless.

local script, server script, and remote event are all located in a tool

The localscript will not run if it is a descendant of workspace. You should instead move it to somewhere like StarterCharacterScripts and try again.

no the local script is in a tool

It doesn’t matter what the localscript is the direct child of. It will not run if it’s a descendant of workspace (with some exceptions). Again, move it to StarterCharacterScripts and try again.

hey this worked i made the cameraEvent in starter player scripts and it worked! appreciate the help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.