Having a PrimaryPart set overrides the WorldPivot.
You would use CFrame.lookAt to get the orientation from the direction and add the current position to it.
local Flag = workspace.Flag
local function UpdateFlag(GlobalWind)
local Position = Flag:GetPivot().Position
local Rotation = CFrame.lookAt(Vector3.zero, GlobalWind)
Flag:PivotTo(Rotation + Position)
end
UpdateFlag(workspace.GlobalWind)
workspace:GetPropertyChangedSignal("GlobalWind"):Connect(function()
UpdateFlag(workspace.GlobalWind)
end)
This assumes your flag has a WorldPivot of (0, 90, 0)