Values in local script not updating

Currently I’m trying to send a remote event to another script whenever w is pressed. There is another script that changes the “Throttle1” but for some reason the value does not get updated in this script and doesn’t send the updated value. Does anyone know how to make sure the value updates? Here’s the script:

local UIS = game:GetService("UserInputService")

local Plr = game.Players.LocalPlayer
local Character = Plr.Character or Plr.CharacterAdded:Wait()

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.W then
		while UIS:IsKeyDown(Enum.KeyCode.W) do
			if Character.FlightSystemValues.Seated.Value == true and Character.FlightSystemValues.MinimumEngineStarted.Value == true then
				local UpDown = "Up"
				local PlaneName = game.Players.LocalPlayer.Character.FlightSystemValues.PlaneNonLiveryName.Value
				local Throttle1 = Character.FlightSystemValues.Throttle1
				game.ReplicatedStorage.FlightSystem.Throttle:FireServer(Plr, Character, UpDown, PlaneName, Throttle1)
			end
			task.wait(.05)
		end
	end
end)
1 Like

FireServer sends the Player automatically so your actually sending it twice.
so just remove Plr from the code.

game.ReplicatedStorage.FlightSystem.Throttle:FireServer(Character, UpDown, PlaneName, Throttle1)

yes but that doesn’t fix the variable “Throttle1” not updating because other scripts are changing it but this script just always keeps it the same