If statements not working

Hello I was working on an NPC system for my game

There is an if statement checking if the NPC is walking

I want it where if the NPC is not walking then you can talk to the NPC

Here is my code

local Character = script.Parent
local States = Character.States

Character.HumanoidRootPart.Attachment.ProximityPrompt.Triggered:Connect(function(player)
	if not States.Walking.Value then
		-- code to enable a textbox
	else
		warn(Character.Name.. " can't talk right now")
	end
end)

you can check if the npc is walking by

if NPC.Humanoid.MoveDirection.Magnitude > 0 then
--
else

--
end

I change some things in the system nows it works how I want it to be.